/*!
 * author by @xiange 
 * wx:2843269812 
 * gzh:xmcjw178 
 * https://youjiang178.com
 */

/* 完整的CSS样式，包含所有必要定义 */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
	background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
	color: #333;
	line-height: 1.6;
	padding: 20px;
	min-height: 100vh;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
}

header {
	text-align: center;
	margin-bottom: 40px;
	padding: 20px;
}

h1 {
	color: #2c3e50;
	font-size: 2.5rem;
	margin-bottom: 10px;
	position: relative;
	display: inline-block;
}

h1:after {
	content: '';
	position: absolute;
	bottom: -10px;
	left: 50%;
	transform: translateX(-50%);
	width: 100px;
	height: 4px;
	background: linear-gradient(90deg, #3498db, #2ecc71);
	border-radius: 2px;
}

.subtitle {
	color: #7f8c8d;
	font-size: 1.1rem;
	max-width: 600px;
	margin: 20px auto 0;
}

/* 分类筛选样式 */
.category-filter {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-bottom: 30px;
	padding: 15px;
	background: white;
	border-radius: 10px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.category-btn {
	padding: 10px 20px;
	background: #f8f9fa;
	border: 2px solid #e0e0e0;
	border-radius: 25px;
	color: #5a6c7d;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s;
}

.category-btn:hover {
	background: #e3f2fd;
	border-color: #3498db;
	color: #3498db;
}

.category-btn.active {
	background: #3498db;
	border-color: #3498db;
	color: white;
}

.category-btn.all {
	background: #2c3e50;
	border-color: #2c3e50;
	color: white;
}

.category-btn.all.active {
	background: #2ecc71;
	border-color: #2ecc71;
}

/* 为所有分类按钮自动分配颜色 */
.category-btn[data-category]:not(.all) {
	background: var(--category-bg, #f8f9fa);
	border-color: var(--category-border, #e0e0e0);
	color: var(--category-color, #5a6c7d);
}

.category-btn[data-category]:not(.all).active {
	background: var(--category-active-bg, #3498db);
	border-color: var(--category-active-border, #3498db);
	color: white;
}

.category-btn[data-category]:not(.all):hover:not(.active) {
	background: var(--category-hover-bg, #e3f2fd);
	border-color: var(--category-hover-border, #3498db);
	color: var(--category-hover-color, #3498db);
}

.projects-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 30px;
	margin-bottom: 40px;
}

.project-card {
	background: white;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
	position: relative;
}

.project-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.project-header {
	padding: 20px 20px 15px;
	background: linear-gradient(90deg, #f8f9fa, #ffffff);
	border-bottom: 1px solid #eee;
}

.project-title {
	font-size: 1.5rem;
	color: #2c3e50;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
}

.project-icon {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 12px;
	color: white;
	font-weight: bold;
	font-size: 1rem;
}

.project-description {
	color: #5a6c7d;
	font-size: 1rem;
	line-height: 1.5;
}

.project-content {
	padding: 20px;
}

.info-section {
	margin-bottom: 20px;
}

.section-title {
	font-size: 1rem;
	color: #3498db;
	margin-bottom: 10px;
}

.invite-code-box, .link-box, .custom-hint-box, .no-invite-code-box {
	display: flex;
	align-items: center;
	background: #f8f9fa;
	border-radius: 8px;
	padding: 12px 15px;
	margin-bottom: 10px;
	border: 1px solid #eaeaea;
}

.code-text, .hint-text {
	flex: 1;
	font-family: 'Courier New', monospace;
	font-weight: 600;
	color: #2c3e50;
	word-break: break-all;
	padding-right: 10px;
}

.no-invite-code-text {
	flex: 1;
	color: #7f8c8d;
	font-weight: 600;
	padding-right: 10px;
}

.custom-hint-text {
	flex: 1;
	color: #e74c3c;
	font-weight: 600;
	padding-right: 10px;
}

.copy-btn, .open-btn, .download-btn {
	background: #3498db;
	color: white;
	border: none;
	border-radius: 6px;
	padding: 8px 15px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s;
}

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

.copy-btn.copied {
	background: #2ecc71;
}

.open-btn {
	background: #f39c12;
}

.open-btn:hover {
	background: #e67e22;
}

.button-group {
	display: flex;
	gap: 5px;
}

.qrcode-container {
	text-align: center;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 8px;
	margin-top: 5px;
}

.qrcode-image {
	width: 150px;
	height: 150px;
	margin: 0 auto 10px;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
	object-fit: cover;
}

.qrcode-download-btn-container {
	margin: 10px 0;
	text-align: center;
}

.download-btn {
	background: #2ecc71;
}

.download-btn:hover {
	background: #27ae60;
}

.qrcode-text {
	font-size: 0.9rem;
	color: #7f8c8d;
	margin-top: 10px;
}

.tag {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
	margin-right: 8px;
	margin-bottom: 5px;
}

.tag-tech {
	background: #e1f5fe;
	color: #0277bd;
}

.project-footer {
	padding: 15px 20px;
	background: #f8f9fa;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.reward {
	color: #e74c3c;
	font-weight: 600;
}

.success-msg, .error-msg, .download-msg {
	position: fixed;
	bottom: 20px;
	right: 20px;
	color: white;
	padding: 12px 20px;
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
	display: none;
	z-index: 1000;
}

.success-msg {
	background: #2ecc71;
}

.error-msg {
	background: #e74c3c;
}

.download-msg {
	background: #3498db;
}

footer {
	text-align: center;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid #ddd;
	color: #7f8c8d;
	font-size: 0.9rem;
}

.instruction-box {
	background: white;
	border-radius: 10px;
	padding: 20px;
	margin-bottom: 30px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
	border-left: 4px solid #3498db;
}

.instruction-title {
	color: #2c3e50;
	margin-bottom: 10px;
}

.no-projects-msg {
	text-align: center;
	padding: 40px;
	color: #7f8c8d;
	font-size: 1.2rem;
	grid-column: 1 / -1;
}

.category-count {
	display: inline-block;
	background: rgba(255, 255, 255, 0.8);
	color: #2c3e50;
	border-radius: 12px;
	padding: 2px 8px;
	font-size: 0.8rem;
	margin-left: 5px;
}

@media (max-width: 768px) {
	.projects-grid {
		grid-template-columns: 1fr;
	}
	
	h1 {
		font-size: 2rem;
	}
	
	.category-filter {
		gap: 8px;
	}
	
	.category-btn {
		padding: 8px 15px;
		font-size: 0.9rem;
	}
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 80px; /* 放在下载提示消息上方 */
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    display: flex; /* 滚动到一定距离后显示 */
}

/* 调整消息框位置，避免重叠 */
.success-msg, .error-msg, .download-msg {
    bottom: 140px; /* 为返回顶部按钮留出空间 */
}