* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0e6d2;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    text-align: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #8b4513;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.mode-selector, .current-player, .game-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

#gameMode {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    font-size: 14px;
}

#playerDisplay {
    font-weight: bold;
    color: #000;
}

#statusDisplay {
    font-weight: bold;
    color: #28a745;
}

#restartBtn {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

#restartBtn:hover {
    background-color: #0056b3;
}

.game-board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.game-board {
    width: 600px;
    height: 600px;
    background-color: #deb887;
    border: 10px solid #8b4513;
    position: relative;
    display: block;
}

.grid-line {
    position: absolute;
    background-color: #000;
    z-index: 1;
    pointer-events: none;
}

.grid-line.horizontal {
    width: 100%;
    height: 1px;
}

.grid-line.vertical {
    width: 1px;
    height: 100%;
}

.intersection {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
}

.cell {
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 2;
}

.cell:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .cell {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 20px;
        height: 20px;
    }
}

.stone {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    z-index: 3;
    pointer-events: none;
}

.stone.black {
    background-color: #000;
}

.stone.white {
    background-color: #fff;
    border: 1px solid #ccc;
}

.stone:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.player-label {
    font-weight: bold;
    font-size: 18px;
}

.player-label.black {
    color: #000;
}

.player-label.white {
    color: #666;
}

.score {
    font-size: 24px;
    font-weight: bold;
    color: #8b4513;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-board {
        width: 95vw;
        height: 95vw;
        max-width: 400px;
        max-height: 400px;
        border: 6px solid #8b4513;
    }
    
    .stone {
        width: 20px;
        height: 20px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-board {
        gap: 30px;
    }
    
    .game-info div {
        font-size: 14px;
    }
    
    #restartBtn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .game-board {
        width: 90vw;
        height: 90vw;
        max-width: 320px;
        max-height: 320px;
        border: 4px solid #8b4513;
    }
    
    .stone {
        width: 16px;
        height: 16px;
    }
    
    h1 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }
    
    .game-info {
        gap: 8px;
    }
    
    .game-info div {
        font-size: 12px;
    }
    
    .score-board {
        gap: 20px;
    }
    
    .score {
        font-size: 20px;
    }
    
    #restartBtn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .container {
        padding: 15px;
        margin: 10px;
    }
}