/* 全局样式设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f0f0;
    min-height: 100vh;
    padding: 20px;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* 容器样式 */
.container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 游戏标题样式 */
.game-title h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.game-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* 游戏说明样式 */
.game-instructions {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.game-instructions h2 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.game-instructions p {
    color: #555;
    font-size: 1rem;
    line-height: 1.5;
}

/* 游戏棋盘样式 */
.game-board-container {
    margin-bottom: 25px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

/* 棋盘格子样式 */
.cell {
    background-color: #f8f9fa;
    border-radius: 8px;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cell:hover {
    background-color: #e9ecef;
    transform: scale(1.03);
}

/* X和O玩家标记样式 */
.cell.x {
    color: #4a6fa5;
}

.cell.o {
    color: #e67e22;
}

/* 获胜格子样式 */
.cell.winner {
    background-color: #d4edda;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 111, 165, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(74, 111, 165, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 111, 165, 0);
    }
}

/* 游戏状态提示样式 */
.game-status {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
}

.current-player {
    color: #4a6fa5;
}

/* 控制按钮样式 */
.control-buttons {
    margin-top: 10px;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn {
    background-color: #4a6fa5;
    color: white;
}

.reset-btn:hover {
    background-color: #3a5a8c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reset-btn:active {
    transform: translateY(0);
}

/* 标记出现动画 */
@keyframes appear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cell.x, .cell.o {
    animation: appear 0.3s ease-in-out;
}

/* 版权信息样式 */
.copyright {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.9rem;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 400px) {
    .container {
        padding: 20px;
    }
    
    .game-title h1 {
        font-size: 2rem;
    }
    
    .game-board {
        grid-gap: 8px;
        max-width: 250px;
    }
    
    .cell {
        font-size: 2.5rem;
    }
    
    .copyright {
        font-size: 0.8rem;
        margin-top: 20px;
        padding-top: 15px;
    }
}
