:root {
	--primary-color: #076cab;
	--secondary-color: #32c9fd;
	--accent-color: #e74c3c;
	--light-color: #ecf0f1;
	--dark-color: #2c3e50;
	--space-blue: #0a1128;
	--space-gradient: linear-gradient(to bottom, #0a1128, #1c2a48);
}

@font-face {
    font-family: 'Weilaiyuan';
    src: url('../assets/fonts/Weilaiyuan.ttf') format('truetype');
}

@font-face {
    font-family: 'SmileySans-Oblique';
    src: url('../assets/fonts/SmileySans-Oblique.ttf') format('truetype');
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}


html, body {
	font-family: 'Microsoft YaHei', sans-serif;
}

body {
	background-color: #f5f7fa;
	color: #333;
	line-height: 1.6;
	/* === 恢复为左右分栏布局 === */
	display: flex; /* 恢复 */
	min-height: 100vh;
}

/* 左侧头图区域 */
.header-container {
	/* === 恢复为左侧固定宽度和高度 === */
	width: 35%; /* 恢复 */
	min-width: 300px; /* 恢复 */
	position: relative;
	/* height: 60vh; REMOVED (上次添加的，现在移除) */
	/* overflow: hidden; REMOVED (上次添加的，现在移除) */
}

header {
	/* === 恢复为左侧固定定位和尺寸 === */
	position: fixed; /* 恢复 */
	top: 0;
	left: 0;
	width: 35%; /* 恢复 */
	height: 100vh; /* 恢复 */
	min-height: 500px; /* 恢复 */
	overflow: hidden;
	display: flex;
	align-items: flex-start; /* 恢复 */
	justify-content: center;
	padding-top: 16.67vh; /* 恢复 */
}

/* 背景现在使用一个 iframe 加载独立的星轨页面 */
.header-background {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -2; /* 放在最底层 */
	overflow: hidden;
}

/* iframe 用于嵌入星轨动画页面 */
.header-background iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	pointer-events: none; /* 防止阻塞 header 内交互 */
}

.header-content {
	max-width: 80%;
	color: white;
	text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
	z-index: 2; /* 确保在 iframe 之上 */
	padding: 2rem;
	text-align: center;
	position: static;
	transform: none;
	pointer-events: auto; /* 保持内部交互 */
}

h1 {
	font-size: 3.2rem;
	margin-bottom: 0.5rem;
	font-family: 'Weilaiyuan', 'Microsoft YaHei', sans-serif;
	font-weight: normal;
	text-shadow: 0 0 10px rgba(0, 0, 0), 0 0 20px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.8);
}

.subtitle {
	font-size: 1.5rem;
	opacity: 0.9;
    margin-bottom: 1rem; /* NEW: Add margin below subtitle for image */
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 0, 0, 0.8);
    font-family: 'SmileySans-Oblique', 'Microsoft YaHei', sans-serif;
}

/* NEW: Custom image style */
.custom-header-image {
    max-width: 80%; /* Adjust as needed */
    height: auto;
    border-radius: 8px; /* Optional: adds a slight roundness */
    margin-bottom: 1rem; /* Space below the image */
}

/* 右侧内容区域 */
.content-container {
	/* === 恢复为右侧占据剩余宽度 === */
	width: 65%; /* 恢复 */
	/* max-width: 1200px; REMOVED (上次添加的，现在移除) */
	/* margin: 0 auto; REMOVED (上次添加的，现在移除) */
	padding: 2rem;
	overflow-y: auto; /* 恢复 */
}

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

.section-title {
	text-align: center;
	margin: 2rem 0;
	position: relative;
}

.section-title h2 {
	display: inline-block;
	background-color: white;
	padding: 0 2rem;
	position: relative;
	z-index: 1;
	font-size: 1.8rem;
	color: var(--dark-color);
}

.section-title::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	background-color: var(--light-color);
	z-index: 0;
}

.category {
	margin-bottom: 3rem;
	background-color: white;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease;
}

.category:hover {
	transform: translateY(-5px);
}

.category-header {
	background: var(--space-gradient);
	color: white;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	position: relative;
	overflow: hidden;
}

.category-header::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-image: 
		radial-gradient(1.5px 1.5px at 15% 25%, white 50%, transparent 55%),
		radial-gradient(1.2px 1.2px at 35% 65%, white 50%, transparent 55%),
		radial-gradient(1px 1px at 55% 35%, white 50%, transparent 55%),
		radial-gradient(1.8px 1.8px at 75% 50%, white 50%, transparent 55%),
		radial-gradient(1.3px 1.3px at 90% 15%, white 50%, transparent 55%),
		radial-gradient(1.5px 1.5px at 25% 80%, white 50%, transparent 55%),
		radial-gradient(1px 1px at 50% 90%, white 50%, transparent 55%),
		radial-gradient(1.7px 1.7px at 65% 75%, white 50%, transparent 55%),
		radial-gradient(1.2px 1.2px at 10% 50%, white 50%, transparent 55%),
		radial-gradient(1.4px 1.4px at 40% 20%, white 50%, transparent 55%),
		radial-gradient(1.6px 1.6px at 80% 35%, white 50%, transparent 55%),
		radial-gradient(1.1px 1.1px at 20% 90%, white 50%, transparent 55%),
		radial-gradient(1.3px 1.3px at 95% 70%, white 50%, transparent 55%),
		radial-gradient(1.5px 1.5px at 60% 10%, white 50%, transparent 55%),
		radial-gradient(1.7px 1.7px at 30% 40%, white 50%, transparent 55%);
	background-size: 100% 100%;
	opacity: 0.5;
	animation: twinkle 8s infinite ease-in-out;
}

@keyframes twinkle {
	0%, 100% { opacity: 0.5; }
	50% { opacity: 0.8; }
}

.category-icon {
	font-size: 1.8rem;
	margin-right: 1rem;
	position: relative;
	z-index: 1;
}

.category-title {
	font-size: 1.5rem;
	font-weight: 600;
	position: relative;
	z-index: 1;
}

.animations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1.5rem;
	padding: 1.5rem;
}

.animation-card {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	background-color: white;
}

.animation-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.animation-cover {
	width: 100%;
	height: 160px;
	object-fit: cover;
	border-bottom: 1px solid #eee;
}

.animation-info {
	padding: 1rem;
	text-align: center;
}

.animation-title {
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--dark-color);
}

.animation-desc {
	font-size: 0.9rem;
	color: #666;
	margin-bottom: 1rem;
}

.view-btn {
	display: inline-block;
	background-color: var(--primary-color);
	color: white;
	padding: 0.5rem 1rem;
	border-radius: 5px;
	text-decoration: none;
	font-size: 0.9rem;
	transition: background-color 0.3s;
}

.view-btn:hover {
	background-color: #2980b9;
}

footer {
	text-align: center;
	font-size: 0.8rem;
	color: #666;
	margin-top: 1rem;
	padding: 0.5rem 0;
	border-top: 1px solid #eee;
}

/* NEW: 左侧边栏触发器样式 */
.left-sidebar-trigger {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; /* 窄边栏 */
    background: rgba(10, 15, 40, 0.7);
    color: white;
    text-align: center;
    padding: 15px 0 10px; /* 调整垂直内边距 */
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    box-shadow: 2px 0 10px rgba(255, 244, 244, 0.4);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px; /* 图标和文字间距 */
    transition: width 0.3s ease, background 0.3s ease;
}

.left-sidebar-trigger:hover {
    width: 60px; /* 悬停时稍微加宽 */
    background: rgba(10, 15, 40, 0.9);
}

.left-sidebar-trigger .sidebar-icon {
    font-size: 1.8rem;
}

.left-sidebar-trigger .sidebar-text {
    font-size: 0.8rem;
    writing-mode: vertical-lr; /* 文字竖排 */
    text-orientation: mixed; /* 保持文字方向不变 */
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* NEW: 全屏覆盖层 */
.full-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 0; /* 默认宽度为0，隐藏 */
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    overflow: hidden;
    transition: width 0.6s ease-out; /* 宽度过渡动画 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.full-screen-overlay.active {
    width: 100vw; /* 激活时全屏 */
}

.full-screen-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.full-screen-overlay .close-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 2001;
}

.full-screen-overlay .close-overlay:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}


/* 悬浮球样式 */
.floating-container {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 2000;
	touch-action: none; /* 防止浏览器处理触摸事件 */
	-webkit-user-select: none; /* 防止选中文本 */
	user-select: none;
}

.main-floating-ball {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: grab;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
	touch-action: none; /* 防止浏览器处理触摸事件 */
	transition: all 0.3s ease;
	position: relative;
	z-index: 10;
	user-select: none;
}

.main-floating-ball:active {
	cursor: grabbing;
}

.main-floating-ball:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
}

.mini-floating-balls {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.mini-ball {
	position: absolute;
	width: 45px;
	height: 45px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
	transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
	opacity: 0;
	transform: translate(0, 0) scale(0.5);
	z-index: 1;
}

/* NEW: Added styles for images inside balls */
.main-floating-ball img,
.mini-ball img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

/* MODIFIED: Re-angled mini-balls to expand top-left */
.floating-container.active .mini-ball {
	transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), transform 0.2s ease;
}

.floating-container.active .mini-ball:nth-child(1) {
	opacity: 1; transform: translate(-85px, 0px) scale(1); transition-delay: 0.1s;
}
.floating-container.active .mini-ball:nth-child(1):hover {
	transform: translate(-85px, 0px) scale(1.15); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.floating-container.active .mini-ball:nth-child(2) {
	opacity: 1; transform: translate(-79px, -33px) scale(1); transition-delay: 0.2s;
}
.floating-container.active .mini-ball:nth-child(2):hover {
	transform: translate(-79px, -33px) scale(1.15); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.floating-container.active .mini-ball:nth-child(3) {
	opacity: 1; transform: translate(-60px, -60px) scale(1); transition-delay: 0.3s;
}
.floating-container.active .mini-ball:nth-child(3):hover {
	transform: translate(-60px, -60px) scale(1.15); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.floating-container.active .mini-ball:nth-child(4) {
	opacity: 1; transform: translate(-33px, -79px) scale(1); transition-delay: 0.4s;
}
.floating-container.active .mini-ball:nth-child(4):hover {
	transform: translate(-33px, -79px) scale(1.15); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.floating-container.active .mini-ball:nth-child(5) {
	opacity: 1; transform: translate(0px, -85px) scale(1); transition-delay: 0.5s;
}
.floating-container.active .mini-ball:nth-child(5):hover {
	transform: translate(0px, -85px) scale(1.15); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* ===== MODIFIED SECTION START ===== */
/* --- 悬浮球 Tooltip 样式 (完整替换) --- */

/* 1. Tooltip 基础样式 */
.tooltip {
	/* 初始状态：隐藏且不占位 */
	position: absolute;
	opacity: 0;
	visibility: hidden;
	pointer-events: none; /* 防止遮挡鼠标事件 */
	z-index: 120; /* 确保在最上层 */
	
	/* 外观样式 */
	background: rgba(0, 0, 0, 0.9);
	color: white;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 13px;
	white-space: nowrap; /* 文字不换行 */
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

	/* 默认将定位原点设置在小球中心 */
	left: 50%;
	top: 50%;

	/* 默认动画效果 */
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* 2. 桌面端悬停样式 (仅在菜单未展开时生效) */
/* 使用 :not(.active) 来避免与展开状态冲突 */
.floating-container:not(.active) .mini-ball:hover .tooltip {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;

	/* 经典左侧定位法：先居中，再向左推一个身位+间距 */
	transform: translate(-100%, -50%);
	margin-left: -12px; /* 增加与小球的间距 */
}

/* 3. 菜单展开时的样式 (由 JS 控制) */
.floating-container.active .mini-ball .tooltip {
	opacity: 1;
	visibility: visible;
	pointer-events: auto; /* 允许点击文字标签 */

	/* 
	   核心定位逻辑:
	   1. translate(-50%, -50%) 将 tooltip 自身中心对准原点（即小球中心）。
	   2. translate(var(--tx), var(--ty)) 应用 JS 计算出的偏移量，将其推到最终位置。
	*/
	transform: translate(-50%, -50%) translate(var(--tx, 0px), var(--ty, 0px));
	
	/* 移除在悬停样式中可能添加的 margin */
	margin-left: 0; 
}


/* 在小屏幕上稍微减小tooltip的字体和内边距 */
@media (max-width: 768px) {
	.floating-container .mini-ball .tooltip {
		font-size: 11px;
		padding: 6px 10px;
	}
}



/* 在小屏幕上稍微减小tooltip的字体和内边距 */
@media (max-width: 768px) {
    .floating-container.active .mini-ball .tooltip {
        font-size: 11px;
        padding: 6px 10px;
    }
}


/* 新增: 隐形背景板的样式 */
.floating-backdrop {
	position: absolute;
	/* 将其置于主球和小球之下 */
	z-index: 5; 
	/* 把它定位在主球的中心 */
	top: 50%;
	left: 50%;
	/* 尺寸要足够大以覆盖所有小球 */
	width: 220px; 
	height: 220px;
	background: transparent; /* 完全透明，用户看不见 */
	border-radius: 50%;
	/* 把它精确地居中 */
	transform: translate(-50%, -50%) scale(0.1); 
	/* 让鼠标可以与之交互 */
	pointer-events: none; 
	opacity: 0;
	transition: all 0.4s ease-in-out;
}

/* 当菜单激活时，展开背景板 */
.floating-container.active .floating-backdrop {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
	pointer-events: auto; /* 允许鼠标悬停 */
}

/* 确保主球和小球在背景板之上 */
.main-floating-ball {
	position: relative;
	z-index: 10;
}
.mini-ball {
	/* ... */
	z-index: 6; /* 确保它在背景板之上 */
}

/* 响应式设计 */
@media (max-width: 992px) {
	/* === 恢复为列布局，但 header-container 仍然占据全宽 === */
	body {
		flex-direction: column;
	}

	.header-container, header {
		width: 100%;
		position: relative;
		height: 50vh;
		padding-top: 0;
		align-items: center;
	}

	.content-container {
		width: 100%;
		margin-top: 8rem; /* Add margin to prevent overlap with header */
	}

	.floating-container {
		bottom: 20px;
		right: 20px;
	}

	.left-sidebar-trigger {
		position: absolute;
		top: 50%;
		left: 0;
		transform: translateY(-50%);
	}
}

@media (max-width: 768px) {
	.animations-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}

	h1 {
		font-size: 2.4rem;
	}

	.subtitle {
		font-size: 1.2rem;
	}

	.header-content {
		padding: 1.5rem;
	}
    /* NEW: Adjust image size on small screens */
    .custom-header-image {
        max-width: 100%;
        max-height: 30vh; /* Limit height to prevent blocking content */
    }

	.main-floating-ball {
		width: 70px;
		height: 70px;
	}

	.mini-ball {
		width: 40px;
		height: 40px;
	}

	/* MODIFIED: Adjusted mini-ball positions for smaller screens */
	.floating-container.active .mini-ball:nth-child(1) { transform: translate(-70px, 0px) scale(1); }
	.floating-container.active .mini-ball:nth-child(1):hover { transform: translate(-70px, 0px) scale(1.15); }

	.floating-container.active .mini-ball:nth-child(2) { transform: translate(-65px, -27px) scale(1); }
	.floating-container.active .mini-ball:nth-child(2):hover { transform: translate(-65px, -27px) scale(1.15); }

	.floating-container.active .mini-ball:nth-child(3) { transform: translate(-49px, -49px) scale(1); }
	.floating-container.active .mini-ball:nth-child(3):hover { transform: translate(-49px, -49px) scale(1.15); }

	.floating-container.active .mini-ball:nth-child(4) { transform: translate(-27px, -65px) scale(1); }
	.floating-container.active .mini-ball:nth-child(4):hover { transform: translate(-27px, -65px) scale(1.15); }

	.floating-container.active .mini-ball:nth-child(5) { transform: translate(0px, -70px) scale(1); }
	.floating-container.active .mini-ball:nth-child(5):hover { transform: translate(0px, -70px) scale(1.15); }
}

/* 致谢弹窗样式 */
#acknowledgments-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000;
	justify-content: center;
	align-items: center;
}

#acknowledgments-modal .modal-content {
	background: #F0F8FF;
	padding: 2rem;
	border-radius: 10px;
	max-width: 500px;
	width: 90%;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	text-align: center;
}

#acknowledgments-modal h2 {
	color: var(--dark-color);
	font-family: 'Weilaiyuan', 'Microsoft YaHei', sans-serif;
	margin-bottom: 1rem;
	text-align: center;
}

#acknowledgments-modal #acknowledgments-text p {
	font-family: 'Microsoft YaHei', sans-serif;
	font-size: 1rem;
	margin-bottom: 1rem;
	line-height: 1.5;
	text-align: left;
	text-indent: 2em;
}

#acknowledgments-modal button {
	background-color: var(--primary-color);
	color: white;
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 1rem;
	transition: background-color 0.3s;
	display: block;
	margin: 0 auto;
}

#acknowledgments-modal button:hover {
	background-color: #2980b9;
}

