* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 1200px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #333;
    font-size: 2.5em;
    font-weight: 600;
}

.game-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* 控制面板样式 */
.control-panel {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 16px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.label {
    color: #666;
    font-weight: 500;
}

.value {
    color: #333;
    font-weight: 600;
}

.game-settings {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.setting-group select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.setting-group select:hover {
    border-color: #667eea;
}

.setting-group select:focus {
    outline: none;
    border-color: #667eea;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.game-message {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 15px;
    color: #333;
    min-height: 50px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.game-message:empty {
    display: none;
}

.ai-thinking {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffc107;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-message {
    animation: fadeIn 0.3s ease;
}

/* 棋盘容器样式 */
.board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-board {
    border: 2px solid #333;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background: #daa520;
    transition: box-shadow 0.3s ease;
}

#game-board:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

#game-board:active {
    transform: scale(0.995);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .control-panel {
        flex: none;
        width: 100%;
        max-width: 600px;
    }
    
    #game-board {
        width: 100%;
        max-width: 600px;
        height: auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    #game-board {
        max-width: 100%;
    }
}
