/* ============================================================
   方 · 个人主页样式
   深色玻璃拟态 + 渐变光效，支持明/暗主题
   ============================================================ */

:root {
	--primary: #7c9cff;
	--accent: #ff7eb3;
	--grad: linear-gradient(120deg, #7c9cff, #b07cff 45%, #ff7eb3);
	--bg: #0b0f1a;
	--bg-alt: #0f1424;
	--card: rgba(255, 255, 255, 0.055);
	--card-border: rgba(255, 255, 255, 0.11);
	--text: #eaeefb;
	--text-dim: #9aa5c0;
	--shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	--radius: 18px;
	--nav-h: 66px;
}

html[data-theme="light"] {
	--bg: #f4f6fc;
	--bg-alt: #e9edf8;
	--card: rgba(255, 255, 255, 0.72);
	--card-border: rgba(20, 30, 60, 0.1);
	--text: #1b2136;
	--text-dim: #5c6784;
	--shadow: 0 18px 44px rgba(30, 45, 90, 0.14);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--nav-h);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui,
		-apple-system, "Segoe UI", sans-serif;
	overflow-x: hidden;
	transition: background 0.4s ease, color 0.4s ease;
}

a {
	color: var(--primary);
	text-decoration: none;
	transition: color 0.25s ease;
}
a:hover {
	color: var(--accent);
}

::selection {
	background: var(--primary);
	color: #fff;
}

/* 滚动条 */
::-webkit-scrollbar {
	width: 9px;
	height: 9px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, var(--primary), var(--accent));
	border-radius: 99px;
}

/* ---------------- 加载动画 ---------------- */
#preloader {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 22px;
	background: var(--bg);
	transition: opacity 0.6s ease, visibility 0.6s ease;
}
#preloader.hide {
	opacity: 0;
	visibility: hidden;
}
.loader-ring {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: 3px solid transparent;
	border-top-color: var(--primary);
	border-right-color: var(--accent);
	animation: spin 0.9s linear infinite;
}
.loader-text {
	margin: 0;
	color: var(--text-dim);
	letter-spacing: 3px;
	font-size: 13px;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------------- 鼠标光点 ---------------- */
#cursor-canvas {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* ---------------- 导航 ---------------- */
.site-nav {
	height: var(--nav-h);
	background: transparent;
	transition: background 0.35s ease, backdrop-filter 0.35s ease,
		box-shadow 0.35s ease;
}
.site-nav.scrolled {
	background: color-mix(in srgb, var(--bg) 78%, transparent);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	box-shadow: 0 6px 26px rgba(0, 0, 0, 0.22);
}
.site-nav .navbar-brand {
	display: flex;
	align-items: center;
	gap: 9px;
	font-weight: 700;
	font-size: 20px;
	color: #fff;
	letter-spacing: 1px;
}
.site-nav.scrolled .navbar-brand {
	background: var(--grad);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.site-nav .nav-link {
	position: relative;
	color: rgba(255, 255, 255, 0.86);
	font-size: 15px;
	padding: 6px 2px;
	margin: 0 12px;
	transition: color 0.25s ease;
}
.site-nav.scrolled .nav-link {
	color: var(--text);
}
.site-nav .nav-link::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--grad);
	transform: translateX(-50%);
	transition: width 0.3s ease;
}
.site-nav .nav-link:hover::after,
.site-nav .nav-link.active::after {
	width: 100%;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
	color: #fff;
}
.site-nav.scrolled .nav-link:hover,
.site-nav.scrolled .nav-link.active {
	color: var(--primary);
}
.site-nav .nav-blog {
	border: 1px solid rgba(255, 255, 255, 0.32);
	border-radius: 99px;
	padding: 5px 16px !important;
}
.site-nav.scrolled .nav-blog {
	border-color: var(--card-border);
	background: var(--card);
}
.navbar-toggler {
	border: none;
	color: #fff;
	padding: 4px 8px;
}
.navbar-toggler:focus {
	box-shadow: none;
}
.site-nav.scrolled .navbar-toggler {
	color: var(--text);
}
@media (max-width: 991.98px) {
	#navMenu {
		margin-top: 8px;
		padding: 12px 16px;
		border-radius: 16px;
		background: color-mix(in srgb, var(--bg) 94%, transparent);
		backdrop-filter: blur(16px);
		border: 1px solid var(--card-border);
	}
	.site-nav .nav-link {
		color: var(--text);
		margin: 2px 0;
	}
}
.theme-toggle {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--card-border);
	background: var(--card);
	color: var(--text);
	cursor: pointer;
	transition: transform 0.3s ease, background 0.3s ease;
}
.theme-toggle:hover {
	transform: rotate(35deg) scale(1.08);
}

/* ---------------- 首屏 ---------------- */
.hero {
	position: relative;
	min-height: 100vh;
	display: flex;
	align-items: center;
	overflow: hidden;
}
.hero-swiper {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
}
.hero-swiper .swiper-slide {
	background-size: cover;
	background-position: center;
	transform: scale(1.06);
	transition: transform 7s linear;
}
.hero-swiper .swiper-slide-active {
	transform: scale(1);
}
.hero-mask {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: radial-gradient(
			circle at 50% 42%,
			rgba(11, 15, 26, 0.32) 0%,
			rgba(11, 15, 26, 0.72) 55%,
			rgba(11, 15, 26, 0.95) 100%
		),
		linear-gradient(180deg, rgba(11, 15, 26, 0.6), transparent 30%, rgba(11, 15, 26, 0.92));
}
.hero-content {
	position: relative;
	z-index: 2;
	text-align: center;
	color: #fff;
	padding-top: 40px;
}
.avatar-ring {
	width: 148px;
	height: 148px;
	margin: 0 auto 24px;
	padding: 4px;
	border-radius: 50%;
	background: var(--grad);
	animation: floaty 5s ease-in-out infinite;
	box-shadow: 0 0 42px rgba(124, 156, 255, 0.5);
}
.avatar-ring img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid rgba(11, 15, 26, 0.85);
	display: block;
}
@keyframes floaty {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-11px);
	}
}
.hero-name {
	font-size: clamp(2.4rem, 6vw, 4rem);
	font-weight: 800;
	letter-spacing: 6px;
	margin: 0 0 14px;
	background: linear-gradient(120deg, #ffffff, #cfe0ff 50%, #ffd6e8);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-shadow: 0 8px 40px rgba(124, 156, 255, 0.35);
}
.hero-sub {
	min-height: 34px;
	font-size: clamp(0.95rem, 2.4vw, 1.18rem);
	color: rgba(255, 255, 255, 0.86);
	letter-spacing: 1.5px;
	margin-bottom: 26px;
}
.caret {
	color: var(--accent);
	animation: blink 1s steps(2) infinite;
	margin-left: 2px;
}
@keyframes blink {
	50% {
		opacity: 0;
	}
}
.hero-social {
	display: flex;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
}
.hero-social a {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	color: #fff;
	font-size: 18px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.22);
	backdrop-filter: blur(8px);
	transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.hero-social a:hover {
	transform: translateY(-5px) scale(1.08);
	background: var(--grad);
	color: #fff;
	box-shadow: 0 12px 26px rgba(124, 156, 255, 0.45);
}
.scroll-down {
	position: absolute;
	left: 50%;
	bottom: 26px;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.75);
	font-size: 20px;
	animation: bounce 1.9s ease-in-out infinite;
}
@keyframes bounce {
	0%,
	100% {
		transform: translate(-50%, 0);
	}
	50% {
		transform: translate(-50%, 10px);
	}
}

/* ---------------- 通用区块 ---------------- */
.section {
	position: relative;
	z-index: 2;
	padding: 96px 0;
}
.section-alt {
	background: color-mix(in srgb, var(--bg-alt) 85%, transparent);
}
.section-head {
	text-align: center;
	margin-bottom: 52px;
}
.section-tag {
	display: inline-block;
	font-size: 12px;
	letter-spacing: 4px;
	text-transform: uppercase;
	color: var(--primary);
	margin-bottom: 10px;
}
.section-title {
	display: inline-block;
	font-size: clamp(1.6rem, 3.6vw, 2.2rem);
	font-weight: 700;
	margin: 0;
	position: relative;
	padding-bottom: 14px;
}
.section-title::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 62px;
	height: 4px;
	border-radius: 4px;
	background: var(--grad);
}
.section-desc {
	color: var(--text-dim);
	margin: 16px 0 0;
}

.glass {
	background: var(--card);
	border: 1px solid var(--card-border);
	border-radius: var(--radius);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	box-shadow: var(--shadow);
}

/* ---------------- 关于 ---------------- */
.about-card {
	padding: 32px 22px;
	text-align: center;
}
.about-avatar {
	width: 104px;
	height: 104px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid transparent;
	background: var(--grad) border-box;
	-webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	margin-bottom: 16px;
}
.about-name {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 6px;
}
.about-role {
	color: var(--primary);
	font-size: 14px;
	margin-bottom: 18px;
}
.about-meta {
	list-style: none;
	padding: 0;
	margin: 0;
	text-align: left;
	display: inline-block;
}
.about-meta li {
	color: var(--text-dim);
	font-size: 14px;
	margin-bottom: 9px;
}
.about-meta i {
	width: 20px;
	color: var(--accent);
}
.about-body {
	padding: 32px;
	height: 100%;
}
.about-body > p {
	color: var(--text-dim);
	line-height: 1.95;
	white-space: pre-line;
	margin-bottom: 28px;
}
.skill-item {
	margin-bottom: 18px;
}
.skill-top {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	margin-bottom: 8px;
}
.skill-top span:last-child {
	color: var(--primary);
}
.skill-bar {
	height: 8px;
	border-radius: 99px;
	background: color-mix(in srgb, var(--text) 12%, transparent);
	overflow: hidden;
}
.skill-bar > i {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 99px;
	background: var(--grad);
	transition: width 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------- 时间线 ---------------- */
.timeline {
	position: relative;
	max-width: 860px;
	margin: 0 auto;
	padding: 10px 0;
}
.timeline::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 2px;
	transform: translateX(-50%);
	background: linear-gradient(180deg, transparent, var(--primary), var(--accent), transparent);
}
.tl-item {
	position: relative;
	width: 50%;
	padding: 0 40px 36px 0;
}
.tl-item:nth-child(even) {
	margin-left: 50%;
	padding: 0 0 36px 40px;
}
.tl-dot {
	position: absolute;
	top: 22px;
	right: -9px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--bg);
	border: 3px solid var(--primary);
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 20%, transparent);
}
.tl-item:nth-child(even) .tl-dot {
	right: auto;
	left: -9px;
	border-color: var(--accent);
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 20%, transparent);
}
.tl-card {
	padding: 20px 22px;
	transition: transform 0.35s ease;
}
.tl-card:hover {
	transform: translateY(-6px);
}
.tl-date {
	display: inline-block;
	font-size: 12px;
	letter-spacing: 1px;
	padding: 3px 12px;
	border-radius: 99px;
	background: var(--grad);
	color: #fff;
	margin-bottom: 10px;
}
.tl-title {
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 8px;
}
.tl-text {
	color: var(--text-dim);
	font-size: 14px;
	line-height: 1.8;
	margin: 0;
}
@media (max-width: 767.98px) {
	.timeline::before {
		left: 9px;
	}
	.tl-item,
	.tl-item:nth-child(even) {
		width: 100%;
		margin-left: 0;
		padding: 0 0 30px 36px;
	}
	.tl-dot,
	.tl-item:nth-child(even) .tl-dot {
		left: 0;
		right: auto;
	}
}


/* ---------------- 友链 ---------------- */
.friend-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px;
	height: 100%;
	color: var(--text);
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.friend-card:hover {
	transform: translateY(-7px);
	color: var(--text);
	box-shadow: 0 20px 40px rgba(124, 156, 255, 0.22);
}
.friend-card img {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 52px;
	border: 2px solid var(--card-border);
}
.friend-name {
	font-weight: 600;
	margin: 0 0 4px;
	font-size: 15px;
}
.friend-desc {
	color: var(--text-dim);
	font-size: 13px;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------------- 文章 ---------------- */
.post-loading {
	color: var(--text-dim);
	padding: 40px 0;
}
.post-card {
	display: block;
	padding: 22px;
	height: 100%;
	color: var(--text);
	transition: transform 0.35s ease, border-color 0.35s ease;
}
.post-card:hover {
	transform: translateY(-7px);
	color: var(--text);
	border-color: var(--primary);
}
.post-date {
	font-size: 12px;
	color: var(--text-dim);
	letter-spacing: 1px;
}
.post-title {
	font-size: 17px;
	font-weight: 600;
	margin: 10px 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.post-summary {
	color: var(--text-dim);
	font-size: 13.5px;
	line-height: 1.8;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.btn-more {
	display: inline-block;
	padding: 11px 30px;
	border-radius: 99px;
	background: var(--grad);
	color: #fff;
	font-size: 15px;
	box-shadow: 0 12px 28px rgba(124, 156, 255, 0.35);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-more:hover {
	color: #fff;
	transform: translateY(-3px);
	box-shadow: 0 18px 34px rgba(255, 126, 179, 0.42);
}

/* ---------------- 页脚 ---------------- */
.site-footer {
	position: relative;
	z-index: 2;
	padding: 52px 0 36px;
	text-align: center;
	border-top: 1px solid var(--card-border);
	background: color-mix(in srgb, var(--bg-alt) 90%, transparent);
}
.footer-social {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-bottom: 22px;
}
.footer-social a {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--card);
	border: 1px solid var(--card-border);
	color: var(--text-dim);
	transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.footer-social a:hover {
	transform: translateY(-4px);
	background: var(--grad);
	color: #fff;
}
.footer-line {
	margin: 0 0 8px;
	font-size: 13.5px;
	color: var(--text-dim);
}
.footer-line.dim {
	font-size: 12.5px;
	opacity: 0.78;
}

/* ---------------- 悬浮控件 ---------------- */
.floating {
	position: fixed;
	right: 20px;
	bottom: 24px;
	z-index: 900;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.float-btn {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--card-border);
	background: color-mix(in srgb, var(--bg) 72%, transparent);
	backdrop-filter: blur(12px);
	color: var(--text);
	font-size: 16px;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all 0.35s ease;
}
.float-btn.show {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.float-btn:hover {
	background: var(--grad);
	color: #fff;
	border-color: transparent;
}
.float-btn.playing i {
	animation: spin 3s linear infinite;
}
.aplayer-box {
	position: fixed;
	left: 20px;
	bottom: 24px;
	z-index: 900;
	width: 330px;
	max-width: calc(100vw - 40px);
	transform: translateY(140%);
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
	opacity: 0;
}
.aplayer-box.show {
	transform: translateY(0);
	opacity: 1;
}
.aplayer {
	font-family: inherit !important;
	border-radius: 14px !important;
	box-shadow: var(--shadow) !important;
}
@media (max-width: 575.98px) {
	.aplayer-box {
		bottom: 84px;
		left: 12px;
	}
}

/* ---------------- 滚动出现动画 ---------------- */
.reveal {
	opacity: 0;
	transform: translateY(34px);
	transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
	opacity: 1;
	transform: none;
}

/* 隐藏 Live2D 组件自带的 About 按钮 */
button[title="About"] {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
	.reveal {
		opacity: 1;
		transform: none;
	}
}
