* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background-image: linear-gradient(0deg, #eee 1px, transparent 0),
		linear-gradient(90deg, #eee 1px, transparent 0);
	background-size: 30px 30px;
	color: #333;
	min-height: 100dvh;
	overflow: hidden;
}

body.has-maximized-card {
	overflow: hidden;
}

body.is-mobile {
	overflow-y: auto;
}

#board {
	position: relative;
	width: 100vw;
	height: 100dvh;
	overflow: hidden;
}

body.is-mobile #board {
	height: auto;
	min-height: 100dvh;
}

.card {
	position: absolute;
	width: 220px;
	border-radius: 12px;
	box-shadow: 0 16px 35px rgba(0, 0, 0, 0.2);
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	overflow: hidden;
	opacity: 0;
	transform-origin: center;
	transition: transform 0.35s ease, opacity 0.35s ease, left 0.35s ease,
		top 0.35s ease, width 0.35s ease, height 0.35s ease,
		border-radius 0.35s ease;
}

.card.dragging {
	transition: none;
	box-shadow: 0 22px 45px rgba(0, 0, 0, 0.35);
}

.card.maximized {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	border-radius: 0;
	box-shadow: 0 28px 60px rgba(0, 0, 0, 0.4);
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	background: rgba(255, 255, 255, 0.7);
	cursor: grab;
	user-select: none;
	touch-action: pan-y;
}

.card-header.dragging {
	cursor: grabbing;
}

.window-controls {
	display: flex;
	align-items: center;
	gap: 6px;
}

.window-controls .control {
	position: relative;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background: #ccc;
	cursor: pointer;
	outline: none;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.window-controls .control.close {
	background: #ff5f57;
	border-color: #e0443e;
}

.window-controls .control.minimize {
	background: #febb2e;
	border-color: #dea123;
}

.window-controls .control.maximize {
	background: #28c840;
	border-color: #1aab2c;
}

.window-controls .control::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.card-header:hover .window-controls .control::after {
	opacity: 0.8;
}

.window-controls .control.close::after {
	content: '×';
	width: auto;
	height: auto;
	background: none;
	font-size: 10px;
	line-height: 1;
	font-weight: 700;
	color: rgba(0, 0, 0, 0.7);
}

.window-controls .control.minimize::after {
	width: 6px;
	height: 2px;
	background: rgba(0, 0, 0, 0.6);
}

.window-controls .control.maximize::after {
	width: 6px;
	height: 6px;
	background: linear-gradient(
		45deg,
		rgba(0, 0, 0, 0.6) 0%,
		rgba(0, 0, 0, 0.6) 45%,
		transparent 45%,
		transparent 55%,
		rgba(0, 0, 0, 0.6) 55%,
		rgba(0, 0, 0, 0.6) 100%
	);
}

.card-title {
	font-size: 13px;
	font-weight: 600;
	color: rgba(0, 0, 0, 0.55);
	padding-left: 10px;
	flex: 1;
}

.card-body {
	padding: 16px;
	font-size: 16px;
	line-height: 1.4;
	font-weight: 600;
	color: rgba(0, 0, 0, 0.72);
	word-break: break-word;
	overflow-wrap: anywhere;
	white-space: normal;
}

.card.maximized {
	display: flex;
	flex-direction: column;
}

.card.maximized .card-title {
	display: none;
}

.card.maximized .card-body {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-align: center;
	padding: clamp(32px, min(10vw, 10vh), 128px);
	padding-top: clamp(72px, min(14vw, 14vh), 192px);
	font-size: clamp(48px, min(18vw, 18vh), 200px);
	line-height: 1.05;
}

@media (max-width: 768px) {
	.card {
		width: 180px;
		border-radius: 10px;
	}

	.card-body {
		padding: 14px;
		font-size: 14px;
	}

	.card-title {
		font-size: 12px;
	}
}

.footer {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(10px);
	padding: 12px 20px;
	text-align: center;
	font-size: 12px;
	color: #666;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	z-index: 999999;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px;
}

.footer a {
	color: #666;
	text-decoration: none;
	margin: 0 8px;
	transition: color 0.2s ease;
}

.footer a:hover {
	color: #333;
	text-decoration: underline;
}

.footer-divider {
	margin: 0 4px;
	color: #ccc;
}

.footer-copyright {
	color: #999;
	margin: 0 8px;
}

@media (max-width: 768px) {
	.footer {
		font-size: 11px;
		padding: 10px 15px;
	}

	.footer a {
		margin: 0 4px;
	}

	.footer-copyright {
		font-size: 10px;
		margin: 0 4px;
	}
}

/* 音乐控制按钮 */
.music-toggle {
	position: fixed;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(10px);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	z-index: 999998;
	outline: none;
	padding: 0;
}

.music-toggle:hover {
	background: rgba(255, 255, 255, 1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
	transform: scale(1.05);
}

.music-toggle:active {
	transform: scale(0.95);
}

.music-icon {
	width: 24px;
	height: 24px;
	stroke-width: 2;
	color: #666;
	transition: color 0.3s ease;
}

.music-toggle:hover .music-icon {
	color: #333;
}

.music-toggle.playing .play-icon {
	display: none;
}

.music-toggle.playing .pause-icon {
	display: block !important;
}

@media (max-width: 768px) {
	.music-toggle {
		top: 15px;
		right: 15px;
		width: 45px;
		height: 45px;
	}

	.music-icon {
		width: 20px;
		height: 20px;
	}
}

/* 自动播放失败提示 */
.music-tip {
	position: fixed;
	top: 80px;
	left: 50%;
	transform: translateX(-50%) translateY(-100px);
	z-index: 9999999;
	opacity: 0;
	visibility: hidden;
	transition: all 0.4s ease;
	pointer-events: none;
}

.music-tip.show {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.music-tip-content {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(15px);
	padding: 12px 24px;
	border-radius: 30px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.tip-icon {
	width: 18px;
	height: 18px;
	color: #666;
	stroke-width: 2;
	flex-shrink: 0;
}

.music-tip-content p {
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	color: #666;
	white-space: nowrap;
}

@media (max-width: 768px) {
	.music-tip {
		top: 70px;
	}

	.music-tip-content {
		padding: 10px 20px;
		border-radius: 25px;
	}

	.tip-icon {
		width: 16px;
		height: 16px;
	}

	.music-tip-content p {
		font-size: 12px;
	}
}

