/* ============================================================
   apiup.cn 主站统一样式
   设计：深色视频背景 + 玻璃拟态 + 响应式
   优化：海报图 WebP 打底 / 视频按需加载 / 移动端适配
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: "Kaiti SC", "楷体", "KaiTi", "PingFang SC", "Microsoft YaHei", sans-serif;
	color: #fff;
	background: #0e1116;
	min-height: 100vh;
	overflow-x: hidden;
}

a {
	text-decoration: none;
	color: inherit;
}

/* ---------- 视频背景 ---------- */
.bg {
	position: fixed;
	inset: 0;
	z-index: -2;
	overflow: hidden;
	/* 海报图打底：视频未加载时立刻有画面，避免黑屏 */
	background: #0e1116 url("../video/poster.webp") center / cover no-repeat;
}

.bg video {
	position: absolute;
	top: 50%;
	left: 50%;
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	transform: translateX(-50%) translateY(-50%);
	object-fit: cover;
	opacity: 0;
	transition: opacity .8s ease;
}

.bg video.is-ready {
	opacity: 1;
}

/* 渐变遮罩，保证前景可读性 */
.bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(10, 12, 18, .55) 0%, rgba(10, 12, 18, .35) 40%, rgba(10, 12, 18, .75) 100%);
}

/* ---------- 视频播放开关 ---------- */
.vtoggle {
	position: fixed;
	right: 18px;
	bottom: 96px;
	z-index: 12;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	font-size: 12px;
	font-family: inherit;
	color: rgba(255, 255, 255, .8);
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 999px;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	cursor: pointer;
	transition: all .25s ease;
}

.vtoggle:hover {
	color: #fff;
	background: rgba(255, 255, 255, .16);
	border-color: rgba(255, 255, 255, .28);
}

.vtoggle .dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .35);
	transition: background .25s ease;
}

.vtoggle.is-on .dot {
	background: #ff4d6d;
	box-shadow: 0 0 8px rgba(255, 77, 109, .8);
}

@media (max-width: 760px) {
	.vtoggle {
		bottom: 132px;
		right: 12px;
		padding: 7px 12px;
		font-size: 11px;
	}
}

/* ---------- 顶部导航 ---------- */
.navbar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 14px 32px;
	background: rgba(255, 255, 255, .06);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.logo {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 1px;
	white-space: nowrap;
}

.logo span {
	color: #ff4d6d;
}

.nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 4px;
	max-width: 100%;
}

.nav a {
	display: inline-block;
	padding: 7px 16px;
	font-size: 14px;
	border-radius: 999px;
	border: 1px solid transparent;
	transition: all .25s ease;
	color: rgba(255, 255, 255, .85);
}

.nav a:hover {
	color: #fff;
	background: rgba(255, 255, 255, .14);
	border-color: rgba(255, 255, 255, .2);
}

.nav a.active {
	background: #fff;
	color: #111;
	font-weight: 600;
}

/* ---------- 主视觉 Hero ---------- */
.hero {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 120px 20px 180px;
}

.hero h1 {
	font-family: "Century Gothic", "Segoe UI", sans-serif;
	font-size: clamp(44px, 9vw, 92px);
	font-weight: 700;
	letter-spacing: 2px;
	line-height: 1.15;
	background: linear-gradient(120deg, #ffffff 20%, #ffd6de 45%, #ff4d6d 80%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 8px 40px rgba(255, 77, 109, .25);
}

.hero h1 .accent {
	-webkit-text-fill-color: initial;
	color: #ff4d6d;
}

.hero .sub {
	margin-top: 20px;
	font-size: clamp(15px, 2.4vw, 20px);
	color: rgba(255, 255, 255, .78);
	letter-spacing: 4px;
}

.hero .desc {
	margin-top: 10px;
	font-size: 14px;
	color: rgba(255, 255, 255, .5);
	letter-spacing: 1px;
}

/* ---------- 页脚 ---------- */
.footer {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 10;
	padding: 14px 20px 18px;
	text-align: center;
	font-size: 12px;
	background: linear-gradient(180deg, rgba(10, 12, 18, 0) 0%, rgba(10, 12, 18, .72) 60%);
	color: rgba(255, 255, 255, .62);
	line-height: 1.9;
}

.footer a {
	color: rgba(255, 255, 255, .72);
	transition: color .2s;
}

.footer a:hover {
	color: #ff4d6d;
}

.footer .links a::after {
	content: "·";
	margin: 0 10px;
	color: rgba(255, 255, 255, .3);
}

.footer .links a:last-child::after {
	content: none;
}

/* ---------- 响应式：移动端 ---------- */
@media (max-width: 760px) {
	.navbar {
		flex-direction: column;
		gap: 10px;
		padding: 12px 12px 10px;
	}

	.nav {
		justify-content: flex-start;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		width: 100%;
	}

	.nav::-webkit-scrollbar {
		display: none;
	}

	.nav a {
		padding: 6px 13px;
		font-size: 13px;
		white-space: nowrap;
	}

	.hero {
		padding: 150px 16px 190px;
	}

	.footer {
		font-size: 11px;
		padding-bottom: 12px;
		line-height: 1.7;
	}

	.footer .links a::after {
		margin: 0 6px;
	}
}

/* ---------- 减弱动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}

	.bg video {
		display: none;
	}
}
