
        :root {
            --primary: #2962ff;
            --secondary: #0039cb;
            --background: #f5f7ff;
            --dark: #1e1e2f;
            --light: #ffffff;
            --success: #00bfa6;
            --accent: #ff1744;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'SimSun', '宋体', serif;
            background-color: var(--background);
            color: var(--dark);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1.6;
            padding: 20px;
        }

        .container {
            background: var(--light);
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            max-width: 1200px;
            width: 95%;
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            padding: 30px;
            text-align: center;
        }

        .header h1 {
            font-size: 32px;
            margin-bottom: 10px;
            font-weight: 700;
        }

        .header p {
            font-size: 20px;
            opacity: 0.9;
        }

        .main-content {
            display: flex;
            flex-direction: column;
            gap: 20px;
            padding: 30px;
        }

        .content-row {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 30px;
            align-items: start;
        }

        .canvas-area {
            background: #f0f3ff;
            border-radius: 12px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            position: relative;
            min-height: 600px;
            padding: 15px;
        }

        #triangleCanvas {
            width: 100%;
            height: 600px;
            border-radius: 8px;
            cursor: default;
            shape-rendering: geometricPrecision;
        }

        .control-panel {
            background: #f0f3ff;
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            border-left: 1px solid rgba(0, 0, 0, 0.1);
        }

        .control-group {
            margin-bottom: 25px;
        }

        .control-group h3 {
            color: var(--secondary);
            margin-bottom: 15px;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: bold;
        }

        .slider-container {
            margin-bottom: 15px;
        }

        .slider-container label {
            display: block;
            color: var(--secondary);
            margin-bottom: 8px;
            font-weight: bold;
            font-size: 16px;
        }

        .slider-wrapper {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        input[type="range"] {
            flex: 1;
            height: 6px;
            border-radius: 5px;
            background: #d7dcff;
            outline: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        
        input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.2);
            background: var(--secondary);
        }

        .value-display {
            background: white;
            color: var(--dark);
            padding: 8px 12px;
            border-radius: 6px;
            font-weight: bold;
            min-width: 50px;
            text-align: center;
            font-size: 16px;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
        }

        select {
            width: 100%;
            padding: 10px;
            border: 1px solid #d7dcff;
            border-radius: 6px;
            background: white;
            font-size: 16px;
            color: var(--dark);
            cursor: pointer;
        }

        select:focus {
            outline: none;
            border-color: var(--primary);
        }

        .animation-controls {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .animation-controls button {
            min-height: 40px;
            font-size: 16px;
        }

        .rotation-buttons {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .btn-rotation {
            padding: 8px 12px;
            border: none;
            border-radius: 6px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
            min-height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-rotation:hover {
            background: linear-gradient(135deg, var(--secondary), var(--primary));
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
        }

        .btn-rotation:active {
            transform: translateY(0);
        }

        button {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: var(--secondary);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .btn-secondary {
            background: var(--success);
            color: white;
        }

        .btn-secondary:hover {
            background: #00a695;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .formula-display {
            background: white;
            color: var(--dark);
            padding: 20px;
            border-radius: 12px;
            text-align: center;
            margin-top: 15px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            font-size: 22px;
            font-family: "Times New Roman", Times, serif;
            border-top: 3px solid var(--primary);
        }

        .formula-display h4 {
            margin-bottom: 15px;
            font-size: 24px;
            color: var(--secondary);
        }

        .fraction {
            display: inline-block;
            vertical-align: middle;
            text-align: center;
            margin: 0 3px;
            position: relative;
        }

        .numerator {
            display: block;
            border-bottom: 2px solid currentColor;
            padding-bottom: 2px;
            font-size: 20px;
            line-height: 1.1;
            min-width: 12px;
        }

        .denominator {
            display: block;
            padding-top: 2px;
            font-size: 20px;
            line-height: 1.1;
            min-width: 12px;
        }

        .grid-line {
            stroke: #e0e0e0;
            stroke-width: 0.5;
        }

        .grid-line-major {
            stroke: #bdbdbd;
            stroke-width: 1;
        }

        .triangle-original {
            fill: rgba(41, 98, 255, 0.7);
            stroke: var(--primary);
            stroke-width: 2;
            cursor: grab;
            stroke-linejoin: round;
            stroke-linecap: round;
            pointer-events: all;
            shape-rendering: geometricPrecision;
        }

        .triangle-original:active {
            cursor: grabbing;
        }

        .triangle-original.selected {
            stroke: var(--secondary);
            stroke-width: 3;
            filter: drop-shadow(0 0 10px rgba(41, 98, 255, 0.8));
        }

        .triangle-copy {
            fill: rgba(0, 191, 166, 0.7);
            stroke: var(--success);
            stroke-width: 2;
            cursor: grab;
            stroke-linejoin: round;
            stroke-linecap: round;
            pointer-events: all;
            shape-rendering: geometricPrecision;
        }

        .triangle-copy:active {
            cursor: grabbing;
        }

        .triangle-copy.selected {
            stroke: #00a695;
            stroke-width: 3;
            filter: drop-shadow(0 0 10px rgba(0, 191, 166, 0.8));
        }

        .rotation-selected {
            stroke-width: 3;
            filter: drop-shadow(0 0 8px rgba(41, 98, 255, 0.6));
            animation: rotationGlow 2s infinite;
        }

        @keyframes rotationGlow {
            0%, 100% { 
                filter: drop-shadow(0 0 8px rgba(41, 98, 255, 0.6));
            }
            50% { 
                filter: drop-shadow(0 0 12px rgba(41, 98, 255, 0.8));
            }
        }

        .interaction-hint {
            background: rgba(255, 23, 68, 0.1);
            border-left: 4px solid var(--accent);
            padding: 12px;
            border-radius: 8px;
            margin-top: 15px;
            font-size: 16px;
        }

        .interaction-hint h5 {
            color: var(--accent);
            margin-bottom: 5px;
            font-size: 16px;
        }

        .interaction-hint p {
            color: #6b7280;
            margin: 3px 0;
            font-size: 16px;
        }

        .grid-info {
            background: rgba(41, 98, 255, 0.1);
            border-left: 4px solid var(--primary);
            padding: 12px;
            border-radius: 8px;
            margin-top: 15px;
            font-size: 16px;
        }

        .grid-info h5 {
            color: var(--secondary);
            margin-bottom: 5px;
            font-size: 16px;
        }

        .grid-info p {
            color: var(--primary);
            margin: 3px 0;
            font-weight: 500;
            font-size: 16px;
        }

        .footer {
            background: linear-gradient(to right);
            color: #ecf0f1;
            text-align: center;
            padding: 10px;
            margin-top: 15px;
            border-radius: 0 0 10px 10px;
        }

        @media (max-width: 768px) {
            .content-row {
                grid-template-columns: 1fr;
            }
            
            .header h1 {
                font-size: 28px;
            }
            
            .canvas-area {
                height: 350px;
            }
            
            #triangleCanvas {
                height: 350px;
            }
            
            .control-panel {
                border-left: none;
                border-top: 1px solid rgba(0, 0, 0, 0.1);
            }
        }
