:root {
    --bg-color: #f0f0f0;
    --container-bg: #ffffff;
    --text-color: #333;
    --board-light: #decba4;
    --board-dark: #8c6239;
    --highlight: rgba(255, 255, 0, 0.4);
    --hint-dot: rgba(0, 0, 0, 0.1);
}
.DHTitle {
	color: #000000;
	justify-content: center;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --container-bg: #2d2d2d;
        --text-color: #e0e0e0;
        --board-light: #b09b78;
        --board-dark: #5d4037;
    }
	.DHTitle {
		background-color: #1a1a1a;
		color: #FFFFFF;
	}
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-container {
    width: 100%;
    max-width: 900px;
    padding: 10px;
    box-sizing: border-box;
    background: var(--container-bg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 棋盘样式 */
#board-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border: 5px solid #5d4037;
    box-sizing: border-box;
    user-select: none;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.square.light { background-color: var(--board-light); }
.square.dark { background-color: var(--board-dark); }

.square.last-move { background-color: rgba(155, 199, 0, 0.5) !important; }
.square.selected { background-color: var(--highlight) !important; }

.hint-dot {
    width: 25%;
    height: 25%;
    background-color: var(--hint-dot);
    border-radius: 50%;
}

.piece {
    width: 90%;
    height: 90%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s;
}

/* 双人模式下黑子旋转 */
.pvp-mode .piece-black {
    transform: rotate(180deg);
}

/* 控制区 */
.controls {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

button, select {
    padding: 10px;
    border: none;
    border-radius: 5px;
    background: #433b33;
    color: white;
    cursor: pointer;
    font-size: 16px;
    height: 45px;
}

button:disabled { background: #ccc; }

.stats {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

/* 规则区域 */
.rules-section {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #ccc;
    line-height: 1.6;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--container-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 100;
    text-align: center;
}

.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .game-container { padding: 5px; }
    button, select { font-size: 14px; padding: 8px; }
}