/* ==============================================================
   XiaoJiang 导航 · 太空站风格
   ============================================================== */

/* ---------- 全局重置 ---------- */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	width: 100%;
	min-height: 100vh;
	overflow-x: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
	background: #050510;
	color: rgba(255,255,255,0.85);
}

/* ---------- 3D 画布（背景层） ---------- */
#webgl-canvas {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 0;
	pointer-events: none;
}

/* ---------- 空间站"窗口"边框 ---------- */
body::before {
	content: '';
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	z-index: 1;
	pointer-events: none;
	/* 模拟空间站窗户的暗角效果 */
	background: radial-gradient(
		ellipse at center,
		transparent 55%,
		rgba(0,0,0,0.6) 85%,
		rgba(0,0,0,0.85) 100%
	);
}

/* 窗户金属框装饰（四边） */
body::after {
	content: '';
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	z-index: 1;
	pointer-events: none;
	border: 3px solid rgba(180,190,210,0.15);
	border-radius: 12px;
	box-shadow:
		inset 0 0 80px rgba(0,0,0,0.5),
		0 0 30px rgba(100,150,255,0.03);
	backdrop-filter: none;
}

/* ---------- 主容器 ---------- */
#wrap {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	padding: 20px 15px 40px;
}

/* ---------- 顶部 Logo 区域 ---------- */
#top {
	text-align: center;
	padding: 20px 0 10px;
	position: relative;
}

/* Logo=头像 + 标题 + 切换按钮 水平排列 */
#logo {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
}

#logo .logo {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: 2px solid rgba(255,255,255,0.15);
	box-shadow: 0 0 30px rgba(100,150,255,0.15), 0 0 60px rgba(100,150,255,0.05);
	margin-bottom: 8px;
}

.text-js {
	font-size: 30px;
	font-weight: 700;
	background: linear-gradient(135deg, #f0a030 0%, #ff6b35 50%, #f0a030 100%);
	background-size: 200% auto;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	animation: gradientShift 4s ease-in-out infinite alternate;
	text-shadow: none;
	letter-spacing: 2px;
}

@keyframes gradientShift {
	0% { background-position: 0% center; }
	100% { background-position: 100% center; }
}

/* ---------- 切换按钮 ---------- */
#kg-btn {
	margin: 10px 0;
}

.tgl {
	display: none;
}

.tgl-btn {
	display: inline-block;
	padding: 6px 20px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 20px;
	cursor: pointer;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.12);
	color: rgba(255,255,255,0.5);
	transition: all 0.3s ease;
	user-select: none;
	backdrop-filter: blur(4px);
}

.tgl-btn::after {
	content: attr(data-tg-off);
}

.tgl:checked + .tgl-btn {
	background: rgba(255,165,0,0.2);
	border-color: rgba(255,165,0,0.4);
	color: #ffa500;
	box-shadow: 0 0 15px rgba(255,165,0,0.1);
}

.tgl:checked + .tgl-btn::after {
	content: attr(data-tg-on) !important;
}

/* ---------- 图标网格 ---------- */
#main {
	width: 100%;
	max-width: 1030px;
	padding: 10px 0;
}

.app {
	width: 100%;
}

.app ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	justify-content: center;
	padding: 0;
	margin: 0;
}

/* ---------- 浮动图标卡片 ---------- */
.app li {
	animation: floatAnim var(--float-duration, 4s) var(--float-delay, 0s) ease-in-out infinite alternate;
	transition: transform 0.2s ease;
	will-change: transform;
}

.app li a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 115px;
	height: 120px;
	padding: 6px 4px 10px;
	text-decoration: none;
	color: #e0e0e0;
	background: rgba(8,12,25,0.7);
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 16px;
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	position: relative;
	overflow: hidden;
}

/* 悬停发光效果 */
.app li a::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(
		circle at center,
		rgba(100,150,255,0.06) 0%,
		transparent 60%
	);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

.app li a:hover::before {
	opacity: 1;
}

.app li a:hover {
	border-color: rgba(200,230,255,0.35);
	background: rgba(30,50,90,0.5);
	box-shadow:
		0 0 25px rgba(100,180,255,0.15),
		0 0 40px rgba(100,150,255,0.05);
	transform: translateY(-2px);
	color: #fff;
}

/* 图标样式 - 原始尺寸显示 */
.app li a img {
	width: auto;
	height: auto;
	max-width: 75px;
	max-height: 75px;
	object-fit: contain;
	margin-bottom: 4px;
	filter: drop-shadow(0 0 8px rgba(255,255,255,0.15));
	transition: transform 0.3s ease;
}

.app li a:hover img {
	transform: scale(1.15) rotate(-3deg);
}

.app li a strong {
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	color: #e8ecf8;
	transition: color 0.3s ease;
}

.app li a:hover strong {
	color: #fff;
	text-shadow: 0 0 8px rgba(200,230,255,0.3);
}

/* ---------- 浮动动画 ---------- */
@keyframes floatAnim {
	0% {
		transform: translateY(0) rotate(0deg);
	}
	50% {
		transform: translateY(calc(-1 * var(--float-amp, 4px))) rotate(0.5deg);
	}
	100% {
		transform: translateY(calc(var(--float-amp, 4px) * 0.5)) rotate(-0.3deg);
	}
}

/* 让每个图标略微有不同的浮动节奏 */
.app li:nth-child(odd) {
	animation-timing-function: ease-in-out;
}

/* ---------- 互联网/局域网切换显示 ---------- */
#app1 {
	display: none;
}

.tgl:checked ~ #main #app,
.tgl:checked ~ #wrap #main #app {
	display: none;
}

.tgl:checked ~ #main #app1,
.tgl:checked ~ #wrap #main #app1 {
	display: block;
}

/* 默认显示内网 */
#app { display: block; }
#app1 { display: none; }

/* ---------- 底部 ---------- */
#footer {
	text-align: center;
	padding: 15px 0 5px;
}

#footer .custom-link {
	display: inline-block;
	transition: all 0.3s ease;
}

#footer .custom-link:hover {
	background: rgba(255,165,0,0.8) !important;
	box-shadow: 0 0 20px rgba(255,165,0,0.3);
	transform: scale(1.05);
}

footer {
	opacity: 0.5;
	font-size: 12px;
	letter-spacing: 1px;
}

/* ---------- 淡入动画 ---------- */
.animated {
	animation-duration: 0.8s;
	animation-fill-mode: both;
}

.fadeInLeft {
	animation-name: fadeInLeft;
}

@keyframes fadeInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
	#top { padding: 15px 0 10px; }
	#logo { gap: 10px; }
	#logo .logo { width: 52px; height: 52px; }
	.text-js { font-size: 22px; }
	.app li a { width: 130px; height: 125px; padding: 10px 8px; }
	.app li a img { max-width: 60px; max-height: 60px; }
	.app li a strong { font-size: 14px; }
	.app ul { gap: 10px; }
}

@media (max-width: 480px) {
	.app li a { width: 110px; height: 108px; padding: 8px 6px; border-radius: 12px; }
	.app li a img { max-width: 50px; max-height: 50px; }
	.app li a strong { font-size: 12px; }
	.app ul { gap: 8px; }
}
