﻿:root {
            --primary-color: #1e293b;
            --accent-color: #3b82f6;
            --bg-color: #f1f5f9;
            --panel-bg: #ffffff;
            --text-color: #334155;
            --border-color: #e2e8f0;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.6;
            justify-content: center;
            align-items: flex-start;
            min-height: 100vh;
        }

        .container { margin: 20px; }

        .card {
            background: #ffffff;
            border-radius: 20px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
            padding: 40px;
            border: 1px solid var(--border-color);
            position: relative;
        }

        .back-btn {
            position: absolute;
            top: 20px;
            left: 20px;
            text-decoration: none;
            color: var(--accent-color);
            font-weight: 600;
            align-items: center;
            gap: 5px;
            font-size: 0.9rem;
            transition: transform 0.2s;
        }

        .back-btn:hover { transform: translateX(-3px); }

        h1 {
            text-align: center;
            font-size: 2rem;
            color: var(--primary-color);
            margin-bottom: 25px;
            font-weight: 800;
        }

        .description {
            margin-bottom: 30px;
            color: #64748b;
            font-size: 1.05rem;
            text-align: center;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        .sim-wrapper {
            justify-content: center;
            margin: 30px 0;
            overflow: visible;
        }

        #total {
            width: 820px;
            height: 400px;
            background: #fff;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            position: relative;
            box-shadow: 0 4px 12px rgba(0,0,0,0.03);
            overflow: hidden;
            flex-shrink: 0;
            transform-origin: center center;
        }

        #canvas {
            position: absolute;
            left: 0;
            top: 0;
            width: 440px;
            height: 400px;
        }

        #panel {
            position: absolute;
            left: 440px;
            top: 0;
            width: 380px;
            height: 400px;
            background: #f8fafc;
            border-left: 1px solid var(--border-color);
            padding: 12px;
            font-size: 0.85rem;
            overflow-y: auto;
            flex-direction: column;
            gap: 8px;
        }

        .input-group {
            margin-bottom: 0;
            padding: 8px;
            background: white;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }

        .input-row {
            align-items: center;
            gap: 5px;
            margin-top: 4px;
            flex-wrap: nowrap;
        }

        .input-row span {
            white-space: nowrap;
        }

        input[type="text"] {
            width: 50px;
            padding: 3px 6px;
            border: 1px solid #cbd5e1;
            border-radius: 4px;
            font-family: inherit;
        }

        select {
            padding: 3px;
            border: 1px solid #cbd5e1;
            border-radius: 4px;
        }

        .nav-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
            max-width: 150px;
            margin: 10px auto;
        }

        .nav-btn {
            padding: 8px;
            background: #f1f5f9;
            color: #475569;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s;
            width: 100%;
            margin-top: 0;
        }

        .nav-btn:hover {
            background: #e2e8f0;
            color: #0f172a;
        }

        #stop {
            background: #fee2e2;
            color: #ef4444;
        }

        #stop:hover {
            background: #fecaca;
        }

        button {
            width: 100%;
            padding: 10px;
            background: var(--accent-color);
            color: white;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
            margin-top: 5px;
        }

        button:hover { background: #2563eb; }

        .result-box {
            margin-top: 15px;
            padding: 10px;
            background: #eef2ff;
            border-radius: 8px;
            border: 1px solid #c7d2fe;
        }

        .footer-info {
            text-align: center;
            margin-top: 40px;
            font-size: 0.85rem;
            color: #94a3b8;
        }

        /* 响应式缩放 */
        @media (max-width: 850px) {
            #total { /* scale removed */ }
            .sim-wrapper { height: 380px; align-items: center; }
        }
        @media (max-width: 750px) {
            #total { /* scale removed */ }
            .sim-wrapper { height: 340px; }
        }
        @media (max-width: 650px) {
            #total { /* scale removed */ }
            .sim-wrapper { height: 260px; }
            .card { padding: 30px 20px; }
        }
        @media (max-width: 500px) {
            #total { /* scale removed */ }
            .sim-wrapper { height: 200px; }
            h1 { font-size: 1.5rem; }
        }
