/* ============================================================
   导航面板样式 —— 深色/浅色双主题，纯 CSS，无框架依赖
   ============================================================ */

:root {
	--radius: 14px;
	--card-min-w: 172px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
		"PingFang SC", "Noto Sans SC", sans-serif;
}

/* ---------- 深色主题（默认） ---------- */
html[data-theme="dark"] {
	--bg: #101226;
	--text: #eef0ff;
	--text-dim: rgba(238, 240, 255, 0.62);
	--card-bg: rgba(255, 255, 255, 0.08);
	--card-bg-hover: rgba(255, 255, 255, 0.14);
	--card-border: rgba(255, 255, 255, 0.09);
	--card-border-hover: rgba(255, 255, 255, 0.22);
	--search-bg: rgba(255, 255, 255, 0.10);
	--search-border: rgba(255, 255, 255, 0.14);
	--title-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

/* ---------- 浅色主题 ---------- */
html[data-theme="light"] {
	--bg: #eef0fa;
	--text: #23263d;
	--text-dim: rgba(35, 38, 61, 0.60);
	--card-bg: rgba(255, 255, 255, 0.72);
	--card-bg-hover: #ffffff;
	--card-border: rgba(35, 38, 61, 0.08);
	--card-border-hover: rgba(35, 38, 61, 0.22);
	--search-bg: rgba(255, 255, 255, 0.80);
	--search-border: rgba(35, 38, 61, 0.10);
	--title-shadow: 0 2px 18px rgba(35, 38, 61, 0.12);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	min-height: 100%;
}

body {
	font-family: var(--font);
	color: var(--text);
	background: var(--bg);
	transition: background 0.3s ease, color 0.3s ease;
	overflow-x: hidden;
}

/* ---------- 背景装饰（渐变色块，模拟参考站点的波浪效果） ---------- */
.bg {
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	background: linear-gradient(160deg, #141633 0%, #1d1f4e 45%, #101226 100%);
}
html[data-theme="light"] .bg {
	background: linear-gradient(160deg, #dfe3fb 0%, #ece6fa 50%, #e8ecfb 100%);
}
.blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(90px);
	opacity: 0.55;
	animation: drift 26s ease-in-out infinite alternate;
}
.blob-1 {
	width: 55vw; height: 55vw;
	left: -12vw; bottom: -22vw;
	background: radial-gradient(circle at 35% 35%, #e0447f, #7a2450 70%);
}
.blob-2 {
	width: 42vw; height: 42vw;
	right: -10vw; top: -14vw;
	background: radial-gradient(circle at 50% 50%, #3d43c9, #232a86 70%);
	animation-delay: -8s;
}
.blob-3 {
	width: 30vw; height: 30vw;
	right: 18vw; bottom: -8vw;
	background: radial-gradient(circle at 50% 50%, #8a4fd8, #4a2b8f 70%);
	opacity: 0.35;
	animation-delay: -16s;
}
html[data-theme="light"] .blob { opacity: 0.28; }
@keyframes drift {
	from { transform: translate(0, 0) scale(1); }
	to   { transform: translate(4vw, -3vw) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
	.blob { animation: none; }
}

/* ---------- 顶栏 ---------- */
.hero {
	max-width: 1020px;
	margin: 0 auto;
	padding: 56px 20px 8px;
	text-align: center;
}
.brand-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	flex-wrap: wrap;
}
#site-title {
	margin: 0;
	font-size: clamp(30px, 5vw, 46px);
	font-weight: 800;
	letter-spacing: 1px;
	text-shadow: var(--title-shadow);
}
.divider {
	width: 2px;
	height: 40px;
	background: linear-gradient(to bottom, transparent, var(--card-border-hover), transparent);
}
.clock {
	display: flex;
	align-items: baseline;
	gap: 8px;
	text-align: left;
}
#clock-time {
	font-size: clamp(22px, 3.4vw, 30px);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
#clock-date {
	font-size: 13px;
	color: var(--text-dim);
	white-space: pre-line;
	line-height: 1.25;
}

/* ---------- 搜索框 ---------- */
.search {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 620px;
	margin: 26px auto 0;
	padding: 10px 14px;
	border-radius: 999px;
	background: var(--search-bg);
	border: 1px solid var(--search-border);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	transition: border-color 0.2s ease;
}
.search:focus-within { border-color: var(--card-border-hover); }
.search-icon { display: flex; color: var(--text-dim); }
#search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text);
	font-size: 15px;
	font-family: var(--font);
}
#search-input::placeholder { color: var(--text-dim); }
#engine {
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text-dim);
	font-size: 13px;
	font-family: var(--font);
	cursor: pointer;
}
#engine option { color: #23263d; }

/* 搜索联想下拉 */
.suggest {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 6px;
	list-style: none;
	border-radius: 16px;
	background: var(--card-bg-hover);
	border: 1px solid var(--card-border);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	text-align: left;
	max-height: 46vh;
	overflow: auto;
	z-index: 10;
}
.suggest li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 10px;
	cursor: pointer;
	font-size: 14px;
}
.suggest li:hover, .suggest li.active { background: var(--card-bg); }
.suggest li .s-url {
	margin-left: auto;
	font-size: 12px;
	color: var(--text-dim);
	max-width: 45%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- 分组与卡片 ---------- */
.groups {
	max-width: 1020px;
	margin: 0 auto;
	padding: 28px 20px 60px;
}
.group { margin-bottom: 30px; }
.group-title {
	margin: 0 0 12px 2px;
	font-size: 17px;
	font-weight: 700;
	color: var(--text);
}
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--card-min-w), 1fr));
	gap: 12px;
}
.card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 14px;
	border-radius: var(--radius);
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	text-decoration: none;
	color: var(--text);
	transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.card:hover {
	transform: translateY(-3px);
	background: var(--card-bg-hover);
	border-color: var(--card-border-hover);
}
.card:active { transform: translateY(-1px); }
.card-icon {
	flex: none;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
}
.card-icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 8px;
}
.avatar {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 9px;
	font-weight: 700;
	font-size: 16px;
	color: #fff;
	overflow: hidden;
	background: linear-gradient(135deg, hsl(var(--h, 220) 70% 55%), hsl(calc(var(--h, 220) + 40) 70% 42%));
}
.card-text { min-width: 0; }
.card-title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.card-desc {
	display: block;
	font-size: 12px;
	color: var(--text-dim);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.card-desc:empty { display: none; }

/* 高亮搜索命中文字 */
.card mark, .suggest mark {
	background: none;
	color: #ffd479;
	padding: 0;
}
html[data-theme="light"] .card mark,
html[data-theme="light"] .suggest mark { color: #c47a00; }

/* ---------- 底栏 ---------- */
.footer {
	max-width: 1020px;
	margin: 0 auto;
	padding: 0 20px 34px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: var(--text-dim);
	font-size: 12px;
}
#theme-toggle {
	border: 1px solid var(--card-border);
	background: var(--card-bg);
	color: var(--text);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	font-size: 16px;
	cursor: pointer;
	transition: transform 0.15s ease;
}
#theme-toggle:hover { transform: scale(1.08); }

.empty-tip {
	text-align: center;
	color: var(--text-dim);
	padding: 60px 0;
	font-size: 14px;
}
.noscript { text-align: center; padding: 40px; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 560px) {
	:root { --card-min-w: 140px; }
	.hero { padding-top: 40px; }
	.divider { display: none; }
	.clock { text-align: center; }
}
