/* Iosevka - 用于特殊符号排版 */
@font-face {
	font-family: 'Iosevka';
	src: url('fonts/Iosevka-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
/* 页面特有变量 */
:root {
	--text-on-dark: #ffffff;
	--bilibili-blue: #0cb6f2;
	--bilibili-pink: #ff6699;
	--xhs-red: #ff2442;
	--youtube-red: #ff0033;
	--discord-blurple: #5865f2;
	--douyin-black: #161823;
	--qq-brand: #0052d9;
	--wechat-green: #07C160;
	--duolingo-green: #58cc02;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 60px; /* 匹配导航栏高度，防止跳转后由于偏移过大露出英雄区背景 */
}

.nav-container {
	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.nav-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--text-main);
	font-weight: 700;
	font-size: 1.1rem;
	transition: opacity 0.2s;
}

.nav-brand:hover { opacity: 0.8; }

.nav-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(0,0,0,0.05);
}

.nav-links {
	display: flex;
	gap: 30px;
}

.menu-toggle {
	display: none;
	background: none;
	border: none;
	color: var(--text-main);
	cursor: pointer;
	padding: 5px;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
}

.menu-toggle.active { color: var(--primary-blue); }

.menu-toggle svg { width: 24px; height: 24px; stroke: currentColor; }

.nav-links a {
	text-decoration: none;
	color: var(--text-main);
	font-size: 0.9rem;
	font-weight: 500;
	transition: color 0.2s;
	position: relative;
	padding: 4px 0;
}

.nav-links a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--primary-blue);
	transition: width 0.3s ease;
}

.nav-links a:hover { color: var(--primary-blue); }
.nav-links a:hover::after { width: 100%; }

/* --- 导航栏切换按钮 --- */
.nav-theme-toggle {
	background: none;
	border: none;
	color: var(--text-main);
	cursor: pointer;
	padding: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
}
.nav-theme-toggle:hover { color: var(--primary-blue); }
.nav-theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- 导航栏语言切换按钮 --- */
.nav-lang-toggle {
	background: none;
	border: none;
	color: var(--text-main);
	cursor: pointer;
	padding: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
}
.nav-lang-toggle:hover { color: var(--primary-blue); }
/* 禁用图标下的动画下划线伪元素 */
.nav-lang-toggle::after {
	content: none !important;
}
.nav-lang-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- 移动端下拉菜单 --- */
.nav-dropdown {
	position: absolute;
	top: 70px;
	right: 20px;
	background: var(--card-bg);
	border-radius: 12px;
	box-shadow: 0 12px 30px -5px rgba(14, 52, 112, 0.2);
	display: flex;
	flex-direction: column;
	min-width: 150px;
	padding: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
	z-index: 101;
}

.nav-dropdown.active {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.nav-dropdown a {
	text-decoration: none;
	color: var(--text-main);
	padding: 12px 16px;
	font-size: 0.95rem;
	border-radius: 8px;
	transition: background 0.2s;
}
.nav-dropdown a:hover { background: rgba(30, 102, 198, 0.1); color: var(--primary-blue); }

/* --- 英雄区块 (Hero Section) --- */
.hero-section {
	position: relative;
	width: 100%;
	min-height: 450px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-top: 80px;
	color: var(--text-on-dark);
	text-align: center;
	background: linear-gradient(180deg, #90befc 0%, #0e347a 66%, #0b122a 100%);
}

section.hero-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.avatar {
	width: 130px;
	height: 130px;
	border-radius: 50%;
	margin-bottom: 25px;
	object-fit: cover;
	border: 3px solid rgba(255, 255, 255, 0.2);
	background: white;
	box-shadow: 0 12px 40px -8px rgba(8, 15, 38, 0.4);
}

.hero-section h1 {
	font-size: 2.8rem;
	margin-bottom: 5px;
	text-shadow: 0 4px 12px rgba(8, 15, 38, 0.4);
}

.hero-section .tagline {
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.9);
	max-width: 600px;
	margin-bottom: 10px;
	padding: 0 20px;
}

.person-img {
	max-height: 300px;
	position: relative;
	z-index: 3;
	margin-top: 20px;
	margin-bottom: -1px;
	display: block;
}

/* --- 内容区域布局 --- */
.content-section {
	background-color: var(--bg-light);
	padding: 60px 20px;
	text-align: center;
	position: relative;
	z-index: 2;
}

section.container {
	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
}

.section-title {
	font-size: 1.3rem;
	font-weight: 500;
	margin-bottom: 40px;
	position: relative;
	display: inline-block;
}

.section-title::after {
	content: '';
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: -8px;
	width: 30px;
	height: 3px;
	background-color: var(--primary-blue);
}

.section-hint {
	font-size: 0.85rem;
	color: var(--text-sub);
	margin-top: -25px;
	margin-bottom: 30px;
	display: flex;
	justify-content: center;
}

.section-content { margin-bottom: 70px; }
.about-text p { max-width: 600px; margin: 0 auto; color: var(--text-sub); }
.about-text a { color: inherit; text-decoration: none; transition: color 0.2s; } /* 继承文字颜色，加个平滑过渡 */
.about-text a:hover { color: var(--primary-blue); }

/* --- 网格系统 --- */
/* 里程碑部分 */
.milestone-wrapper {
	display: flex;
	gap: 20px;
	position: relative; /* 确保坐标计算基准正确 */
	padding: 20px; /* 恢复对称的正常内边距 */
	overflow-x: auto; /* 允许横向滚动 */
	-webkit-overflow-scrolling: touch; /* 移动端平滑滚动 */
	scrollbar-width: none; /* Firefox 隐藏滚动条 */
	-ms-overflow-style: none; /* IE 10+ 隐藏滚动条 */

	/* 使用 CSS 变量由 JS 动态控制遮罩透明度 */
	--mask-left: black;
	--mask-right: transparent;
	-webkit-mask-image: linear-gradient(to right, var(--mask-left), black 60px, black calc(100% - 60px), var(--mask-right));
	mask-image: linear-gradient(to right, var(--mask-left), black 60px, black calc(100% - 60px), var(--mask-right));
}

.milestone-container {
	position: relative;
	width: 100%;
}

.milestone-nav-btn {
	position: absolute;
	top: 50%;
	translate: 0 -50%;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--card-bg);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--item-border);
	box-shadow: 0 4px 12px rgba(14, 52, 112, 0.15);
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 10;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	color: var(--text-main);
}
.milestone-nav-btn:hover { scale: 1.1; box-shadow: 0 8px 20px rgba(14, 52, 112, 0.2); color: var(--primary-blue); }
.milestone-nav-btn.prev { left: -22px; }
.milestone-nav-btn.next { right: -22px; }
.milestone-nav-btn.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
.milestone-nav-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1100px) {
	.milestone-nav-btn.prev { left: 10px; }
	.milestone-nav-btn.next { right: 10px; }
}

@media (max-width: 768px) {
	.milestone-nav-btn { display: none; }
}

.milestone-wrapper::-webkit-scrollbar {
	display: none; /* Chrome/Safari 隐藏滚动条 */
}

.milestone-card {
	flex: 0 0 300px; /* 固定宽度，不收缩 */
	background: var(--card-bg); /* 使用主题变量 */
	border-radius: var(--card-radius);
	padding: 24px;
	box-shadow: var(--card-shadow); /* 使用主题变量 */
	transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
	border-top: 4px solid var(--primary-blue); /* 顶部蓝色边框，保持与其他卡片一致的视觉风格 */
	text-align: justify; /* 卡片内容两端对齐 */
}
/* 修复深色模式下里程碑卡片文字颜色 */
[data-theme='dark'] .milestone-card h3 { color: var(--text-main); }
[data-theme='dark'] .milestone-card p { color: var(--text-sub); }


.milestone-card .date {
	display: flex;
	align-items: center;
	font-weight: bold;
	color: var(--primary-blue);
	margin-bottom: 12px;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.milestone-tag {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 0.6rem;
	font-weight: 600;
	margin-right: 10px;
	line-height: 1.2;
}
.tag-channel { background: rgba(30, 102, 198, 0.1); color: var(--primary-blue); }
.tag-insync { background: rgba(180, 83, 9, 0.1); color: #b45309; }
.tag-academic { background: rgba(88, 204, 2, 0.1); color: var(--duolingo-green); }
.tag-life { background: rgba(107, 114, 128, 0.1); color: var(--text-sub); }
.tag-nation { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.tag-skill { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.tag-achievement { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }
.tag-community { background: rgba(79, 70, 229, 0.1); color: #4f46e5; }
.tag-anecdote { background: rgba(244, 63, 94, 0.1); color: #f43f5e; }

.milestone-card h3 {
	margin: 0 0 10px 0;
	font-size: 1.25rem;
	color: var(--text-main); /* 使用主题变量 */
}

/* 年份筛选器样式 */
.year-filter-container {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 25px;
	padding: 0 20px;
}
.year-filter-btn {
	width: 70px;
	padding: 8px 0;
	border-radius: 8px;
	background: var(--card-bg);
	border: 1px solid rgba(30, 102, 198, 0.1);
	font-size: 0.85rem;
	font-weight: 400;
	font-family: inherit;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
	text-align: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	color: var(--text-sub);
	box-shadow: 0 2px 8px rgba(14, 52, 112, 0.05);
}
.year-filter-btn:hover { transform: scale(1.1); color: var(--primary-blue); box-shadow: 0 8px 20px rgba(14, 52, 112, 0.2); }
.year-filter-btn.active { background: var(--primary-blue) !important; color: var(--on-primary) !important; border-color: var(--primary-blue) !important; box-shadow: 0 4px 15px rgba(30, 102, 198, 0.3); }

.works-grid, .tools-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 25px;
	margin-top: 30px;
}

.card {
	background-color: var(--card-bg);
	border-radius: var(--card-radius);
	padding: 30px;
	box-shadow: var(--card-shadow);
	text-decoration: none;
	color: var(--text-main);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	translate: 0;
	border: 1px solid var(--item-border);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), translate 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
	height: 100%;
	width: 280px;
}

.card-svg {
	height: 35px;
	width: auto;
	max-width: 200px;
	margin-bottom: 15px;
	fill: currentColor;
	overflow: visible;
}

.card-subtitle { font-size: 0.9rem; font-weight: 500; }
.card:hover { color: white; box-shadow: var(--card-hover-shadow); }
.card.bilibili:hover { background-color: var(--bilibili-blue); }
.card.bilibili-pink:hover { background-color: var(--bilibili-pink); }
.card.xhs:hover { background-color: var(--xhs-red); }
.card.youtube:hover { background-color: var(--youtube-red); }
.card.tool-card:hover { background-color: var(--primary-blue); color: var(--on-primary); }
.card.discord:hover { background-color: var(--discord-blurple); }
.card.qq:hover { background-color: var(--qq-brand); }
.card.wechat:hover { background-color: var(--wechat-green); }
.card.duolingo:hover { background-color: var(--duolingo-green); }
.card.douyin:hover { background-color: var(--douyin-black); color: #fff; }
/* 抖音故障效果切换逻辑 */
.card.douyin .tiktok-base-idle { opacity: 1; transition: opacity 0.2s ease; }
.card.douyin:hover .tiktok-base-idle { opacity: 0; }
.card.douyin .tiktok-cyan, .card.douyin .tiktok-red, .card.douyin .tiktok-white { 
	opacity: 0; transition: opacity 0.2s ease; 
}
.card.douyin:hover .tiktok-cyan { fill: #00faf0; opacity: 1; }
.card.douyin:hover .tiktok-red { fill: #fe2c55; opacity: 1; }
.card.douyin:hover .tiktok-white { fill: #fff; opacity: 1; }
.milestone-card p {
	color: var(--text-sub); /* 使用主题变量 */
	font-size: 0.95rem;
	line-height: 1.6;
	text-align: justify;
}

/* 针对英文版里程碑文字改为左对齐，并保持卡片等宽 */
html[lang="en-US"] .milestone-card,
html[lang="en-US"] .milestone-card p {
	text-align: left;
}

/* 晃动动画 */
@keyframes shake {
	0%, 100% { translate: 0; }
	25% { translate: -8px; }
	50% { translate: 8px; }
	75% { translate: -8px; }
}
.shake { animation: shake 0.4s ease-in-out; }

.footer-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
}

.footer-column {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.footer-column h4 {
	font-size: 0.95rem;
	color: var(--text-main);
	margin-bottom: 15px;
	font-weight: 500 600;
}

section.footer-column p, section.footer-column a {
	font-size: 0.85rem;
	color: #64748b;
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
}

section.footer-column a { transition: color 0.3s; cursor: pointer; }
section.footer-column a:hover { color: var(--primary-blue); }

.footer-bottom {
	text-align: center;
	margin-top: 50px;
	padding-top: 20px;
	border-top: 1px solid #f1f5f9;
	font-size: 0.8rem;
	color: #94a3b8;
	width: 90%;
	max-width: 900px;
	transition: border-color 0.3s ease;
}

.reward-qr {
	width: 220px;
	height: 220px;
	max-width: 100%; /* 防止图片在极窄屏下溢出 */
	height: auto;
}

/* --- 自动深色模式 (跟随浏览器设置) --- */
@media (prefers-color-scheme: dark) { 
	html:not([data-theme='light']) .tag-channel { background: rgba(147, 197, 253, 0.15); }
	html:not([data-theme='light']) .tag-insync { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
	html:not([data-theme='light']) .tag-academic { background: rgba(88, 204, 2, 0.15); }
	html:not([data-theme='light']) .tag-life { background: rgba(148, 163, 184, 0.15); }
	html:not([data-theme='light']) .tag-nation { background: rgba(248, 113, 113, 0.15); color: #f87171; }
	html:not([data-theme='light']) .tag-skill { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
	html:not([data-theme='light']) .tag-achievement { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
	html:not([data-theme='light']) .tag-community { background: rgba(129, 140, 248, 0.15); color: #818cf8; }
	html:not([data-theme='light']) .tag-anecdote { background: rgba(251, 113, 133, 0.15); color: #fb7185; }
	html:not([data-theme='light']) .card.douyin:hover { background-color: #f9f9fa; color: #161823; }
	html:not([data-theme='light']) .card.douyin:hover .tiktok-white { fill: #161823; }
}

[data-theme='dark'] .theme-toggle-btn:hover, [data-theme='dark'] .lang-toggle-btn:hover, 
[data-theme='dark'] .nav-theme-toggle:hover, [data-theme='dark'] .nav-lang-toggle:hover { color: var(--primary-blue) !important; }
[data-theme='dark'] .year-filter-btn { background: var(--card-bg); color: var(--text-sub); }
[data-theme='dark'] .year-filter-btn:hover { color: var(--primary-blue); }
[data-theme='dark'] .card.douyin:hover { background-color: #f9f9fa; color: #161823; }
[data-theme='dark'] .card.douyin:hover .tiktok-white { fill: #161823; }
[data-theme='dark'] .milestone-nav-btn {
	background: var(--card-bg);
	color: #f8fafc;
}
[data-theme='dark'] .tag-channel { background: rgba(147, 197, 253, 0.15); }
[data-theme='dark'] .tag-insync { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
[data-theme='dark'] .tag-academic { background: rgba(88, 204, 2, 0.15); }
[data-theme='dark'] .tag-life { background: rgba(148, 163, 184, 0.15); }
[data-theme='dark'] .tag-nation { background: rgba(248, 113, 113, 0.15); color: #f87171; }
[data-theme='dark'] .tag-skill { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
[data-theme='dark'] .tag-achievement { background: rgba(45, 212, 191, 0.15); color: #2dd4bf; }
[data-theme='dark'] .tag-community { background: rgba(129, 140, 248, 0.15); color: #818cf8; }
[data-theme='dark'] .tag-anecdote { background: rgba(251, 113, 133, 0.15); color: #fb7185; }

@media (max-width: 768px) {
	.desktop-only { display: none; }
    .menu-toggle.mobile-only { display: flex; }
	.hero-section h1 { font-size: 2rem; }
	.card { width: 100%; }
	.tool-card-wrapper { width: 100%; }
	.person-img { max-height: 180px; }
	.footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
	.footer-column { align-items: center; }
	.footer-column p, .footer-column span, .footer-column a { white-space: normal; }
}