
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'SimSun', '宋体', serif;
            background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
            min-height: 100vh;
            color: white;
            padding: 20px;
            overflow-x: auto;
        }
        
        .controls-panel {
            color: #1e293b;
        }
        
        .controls-panel * {
            color: inherit;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .title {
            text-align: center;
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #06b6d4, #0891b2, #0e7490);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }

        .subtitle {
            text-align: center;
            font-size: 1.2rem;
            color: #64748b;
            margin-bottom: 30px;
            font-weight: 400;
        }

        .main-content {
            display: grid;
            grid-template-columns: 2.5fr 1fr;
            gap: 30px;
            margin-bottom: 30px;
        }

        .canvas-container {
            background: #fff;
            border-radius: 20px;
            padding: 30px;
            color: #1e293b;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
            border: 3px solid #e2e8f0;
        }

        .controls-panel {
            background: linear-gradient(135deg, #e3f2fd, #bbdefb);
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .control-section {
            margin-bottom: 25px;
            padding-bottom: 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }

        .control-section:last-child {
            border-bottom: none;
        }

        .control-section h3 {
            font-size: 1.2rem;
            margin-bottom: 15px;
            color: #0e7490;
            font-weight: 600;
        }

        .btn {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 10px;
            font-size: 1rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, #0e7490, #0891b2, #06b6d4);
            color: white;
            box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.8);
            color: #1e293b;
            border: 1px solid rgba(14, 116, 144, 0.3);
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
        }

        .info-panel {
            background: rgba(255, 255, 255, 0.8);
            padding: 15px;
            border-radius: 12px;
            margin-bottom: 15px;
        }

        .distance-display {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 8px;
            color: #1e293b;
        }

        .optimal-badge {
            background: #059669;
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
            display: inline-block;
        }

        .explanation {
            background: rgba(255, 255, 255, 0.1);
            padding: 20px;
            border-radius: 16px;
            margin-top: 20px;
        }

        .explanation h3 {
            color: #FFD700;
            margin-bottom: 15px;
        }

        .explanation ul {
            padding-left: 20px;
        }

        .explanation li {
            margin-bottom: 8px;
            line-height: 1.5;
        }

        .legend {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 1rem;
            padding: 10px 15px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 12px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transition: all 0.2s ease;
            color: #1e293b;
            font-weight: 600;
        }
        
        .legend-item:hover {
            background: rgba(255, 255, 255, 0.9);
            transform: translateY(-1px);
        }

        .legend-color {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.8);
        }

        .footer {
            background: linear-gradient(to right, #2c3e50, #1a2530);
            color: #ecf0f1;
            text-align: center;
            padding: 20px;
            margin-top: 25px;
            border-radius: 0 0 10px 10px;
        }

        @media (max-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            
            .title {
                font-size: 2rem;
            }
            
            #gameCanvas {
                max-width: 100%;
                height: auto;
            }
            
            .container {
                padding: 15px;
            }
        }

        /* Canvas specific styles */
        #gameCanvas {
            cursor: grab;
            border: 3px solid #e2e8f0;
            border-radius: 16px;
            background: #fafafa;
            box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        #gameCanvas:active {
            cursor: grabbing;
        }
