:root {
	/* 浅色主题变量 */
	--bg-color: #f5f5f5;
	--text-color: #333;
	--board-color: #dcb35c;
	--grid-color: #000;
	--black-piece: #000;
	--white-piece: #fff;
	--panel-bg: rgba(255, 255, 255, 0.8);
	--shadow-color: rgba(0, 0, 0, 0.2);
	--button-bg: #4a90e2;
	--button-hover: #3a7bc8;
	--highlight-color: #ffcc00;
	--mode-active: #4CAF50;
}
@media (prefers-color-scheme: dark) {
	:root {
		/* 深色主题变量 */
		--bg-color: #1a1a2e;
		--text-color: #e6e6e6;
		--board-color: #8b7355;
		--grid-color: #e6e6e6;
		--black-piece: #000;
		--white-piece: #f0f0f0;
		--panel-bg: rgba(30, 30, 46, 0.8);
		--shadow-color: rgba(0, 0, 0, 0.5);
		--button-bg: #5a9ae0;
		--button-hover: #4a8ad0;
		--highlight-color: #ffd700;
		--mode-active: #45a049;
	}
}
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
body {
	font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	background-color: var(--bg-color);
	color: var(--text-color);
	padding: 20px;
	transition: background-color 0.3s, color 0.3s;
}
.container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	max-width: 1440px;
	width: 95%;
}
header {
	text-align: center;
	margin-bottom: 10px;
}
h1 {
	font-size: clamp(1.8rem, 5vw, 2.5rem);
	margin-bottom: 10px;
	text-shadow: 2px 2px 4px var(--shadow-color);
}
.game-modes {
	#display: flex;
	gap: 10px;
	margin-bottom: 10px;
}
.mode-btn {
	padding: 8px 16px;
	background: var(--panel-bg);
	border: 2px solid var(--button-bg);
	border-radius: 5px;
	color: var(--text-color);
	cursor: pointer;
	transition: all 0.3s;
	font-weight: bold;
}
.mode-btn.active {
	background: var(--mode-active);
	color: white;
	border-color: var(--mode-active);
}
.game-info {
	display: flex;
	justify-content: space-between;
	width: 100%;
	max-width: 600px;
	background: var(--panel-bg);
	padding: 15px;
	border-radius: 10px;
	backdrop-filter: blur(5px);
	box-shadow: 0 4px 15px var(--shadow-color);
}
.player-info {
	display: flex;
	align-items: center;
	gap: 10px;
}
.player-icon {
	width: 30px;
	height: 30px;
	border-radius: 50%;
}
.black-player .player-icon {
	background: var(--black-piece);
	border: 2px solid var(--white-piece);
}
.white-player .player-icon {
	background: var(--white-piece);
	border: 2px solid var(--black-piece);
}
.current-player {
	font-weight: bold;
	color: var(--highlight-color);
}
.game-status {
	font-size: clamp(1rem, 3vw, 1.2rem);
	font-weight: bold;
	color: var(--highlight-color);
	text-align: center;
	min-height: 30px;
	display: flex;
	align-items: center;
}
.game-board-container {
	position: relative;
	width: 100%;
	max-width: min(95vw, 600px);
	aspect-ratio: 1 / 1;
}
#chessBoard {
	width: 100%;
	height: 100%;
	display: block;
	background-color: var(--board-color);
	border-radius: 5px;
	box-shadow: 0 10px 30px var(--shadow-color);
}
.controls {
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
	justify-content: center;
}
button {
	padding: 10px 20px;
	font-size: 1rem;
	background: var(--button-bg);
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s;
	font-weight: bold;
	box-shadow: 0 4px 6px var(--shadow-color);
}
button:hover {
	background: var(--button-hover);
	transform: translateY(-2px);
	box-shadow: 0 6px 8px var(--shadow-color);
}
button:active {
	transform: translateY(0);
}
button:disabled {
	background: #cccccc;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}
.rules {
	max-width: 600px;
	background: var(--panel-bg);
	padding: 15px;
	border-radius: 10px;
	margin-top: 10px;
	backdrop-filter: blur(5px);
}
.rules h3 {
	margin-bottom: 10px;
	color: var(--highlight-color);
}
.rules ul {
	padding-left: 20px;
}
.rules li {
	margin-bottom: 5px;
}
@media (max-width: 650px) {
	.game-info {
		#flex-direction: column;
		gap: 10px;
	}
	
	.player-info {
		justify-content: center;
	}
}
