        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', sans-serif;
        }
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            color: #333;
            overflow-x: hidden;
        }
        .header {
            text-align: center;
            margin-bottom: 20px;
            width: 100%;
        }
        .header h1 {
            font-size: 2.2rem;
            color: #2c3e50;
            margin-bottom: 10px;
        }
        .header p {
            color: #7f8c8d;
            font-size: 1.1rem;
        }
        .container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 30px;
            max-width: 1600px;
            width: 100%;
        }
        .controls {
            background: white;
            border-radius: 15px;
            padding: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }
        .control-group {
            margin-bottom: 20px;
        }
        .control-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
            color: #2c3e50;
            font-size: 1.1rem;
        }
        .slider-container {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        .slider-container span {
            min-width: 60px;
            text-align: center;
            font-weight: bold;
            color: #3498db;
        }
        input[type="range"] {
            flex: 1;
            height: 10px;
            -webkit-appearance: none;
            appearance: none;
            background: #e0e0e0;
            border-radius: 5px;
            outline: none;
        }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: #3498db;
            cursor: pointer;
            transition: background 0.3s;
        }
        input[type="range"]::-webkit-slider-thumb:hover {
            background: #2980b9;
        }
        .unit-selector {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }
        .unit-selector select {
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid #ddd;
            background: white;
            width: 100%;
        }
        .buttons {
            display: flex;
            gap: 15px;
            margin-top: 25px;
            flex-wrap: wrap;
        }
        button {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 1rem;
            min-width: 80px;
        }
        #reset {
            background: #e74c3c;
            color: white;
        }
        #reset:hover {
            background: #c0392b;
        }
        #clear {
            background: #7f8c8d;
            color: white;
        }
        #clear:hover {
            background: #636e72;
        }
        #fullscreen {
            background: #2ecc71;
            color: white;
        }
        #fullscreen:hover {
            background: #27ae60;
        }
        #layer-view {
            background: #9b59b6;
            color: white;
        }
        #layer-view:hover {
            background: #8e44ad;
        }
        #marker-mode {
            background: #f39c12;
            color: white;
        }
        #marker-mode:hover {
            background: #d35400;
        }
        #function-mode {
            background: #16a085;
            color: white;
        }
        #function-mode:hover {
            background: #1abc9c;
        }
        #developer-mode {
            background: #34495e;
            color: white;
        }
        #developer-mode:hover {
            background: #2c3e50;
        }
        #math-problems {
            background: #e67e22;
            color: white;
        }
        #math-problems:hover {
            background: #d35400;
        }
        .visualization {
            flex: 1;
            min-width: 300px;
            max-width: 1000px;
            height: 600px;
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
        }
        .volume-display {
            font-size: 1.5rem;
            margin-bottom: 20px;
            text-align: center;
            color: #2c3e50;
        }
        .volume-display span {
            color: #e74c3c;
            font-weight: bold;
        }
        #cube-container {
            width: 100%;
            height: 500px;
            background: #f8f9fa;
            border-radius: 8px;
            overflow: hidden;
            position: relative;
        }
        .axis-label {
            position: absolute;
            font-weight: bold;
            color: #3498db;
            background: rgba(255, 255, 255, 0.7);
            padding: 2px 8px;
            border-radius: 4px;
            z-index: 10;
        }
        .length-label {
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
        }
        .width-label {
            top: 50%;
            right: 10px;
            transform: translateY(-50%);
        }
        .height-label {
            top: 10px;
            left: 20px;
        }
        .instructions {
            margin-top: 20px;
            text-align: center;
            color: #7f8c8d;
            font-size: 0.9rem;
        }
        .social-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 30px;
            padding: 15px 25px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 1400px;
        }
        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #3498db;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
        }
        .chat-info {
            display: flex;
            align-items: center;
            gap: 15px;
            color: #7f8c8d;
        }
        .tag {
            background: #3498db;
            color: white;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.9rem;
        }
        
        /* 模态窗口样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 100;
            justify-content: center;
            align-items: center;
        }
        .modal-content {
            background: white;
            padding: 25px;
            border-radius: 15px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
            max-height: 80vh;
            overflow-y: auto;
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .close-modal {
            font-size: 1.5rem;
            cursor: pointer;
            color: #7f8c8d;
        }
        .function-input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin-bottom: 15px;
            font-size: 1rem;
        }
        .geometry-selector {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-bottom: 15px;
        }
        .geometry-btn {
            padding: 10px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.3s;
        }
        .geometry-btn:hover {
            background: #2980b9;
        }
        .annotation-canvas {
            border: 1px solid #ddd;
            border-radius: 8px;
            margin-top: 10px;
            background: white;
        }
        .toolbar {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }
        .tool-btn {
            padding: 8px 12px;
            background: #ecf0f1;
            border: 1px solid #bdc3c7;
            border-radius: 5px;
            cursor: pointer;
        }
        .tool-btn.active {
            background: #3498db;
            color: white;
            border-color: #2980b9;
        }
        .math-problem-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 15px;
        }
        .math-problem-btn {
            padding: 10px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.3s;
            text-align: left;
        }
        .math-problem-btn:hover {
            background: #2980b9;
        }
        .common-functions {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-bottom: 15px;
        }
        .function-btn {
            padding: 10px;
            background: #9b59b6;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.3s;
            font-size: 0.9rem;
        }
        .function-btn:hover {
            background: #8e44ad;
        }

        /* ---- slider + number input row ---- */
        .slider-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        input[type="number"] {
            width: 70px;
            padding: 6px 4px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 0.95rem;
            text-align: center;
        }

        /* ---- 开发者模式: 小数行 + 高级折叠 ---- */
        .geo-num-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 12px;
        }
        .geo-num-row label {
            display: flex;
            flex-direction: column;
            font-size: 0.85rem;
            color: #555;
        }
        .geo-num-row input[type="number"] {
            width: 100%;
            margin-top: 4px;
        }
        .geo-advanced {
            margin-bottom: 15px;
        }
        .geo-advanced summary {
            cursor: pointer;
            font-size: 0.9rem;
            color: #2c3e50;
            margin-bottom: 10px;
            padding: 6px 0;
        }

        /* ---- geometry button active ---- */
        .geometry-btn.active {
            background: #2c3e50;
            box-shadow: 0 0 0 2px #f39c12 inset;
        }

        /* ---- 题目分页页签 ---- */
        .problem-tabs {
            display: flex;
            gap: 0;
            margin-bottom: 15px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid #ddd;
        }
        .problem-tab {
            flex: 1;
            padding: 8px;
            border: none;
            background: #ecf0f1;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9rem;
            color: #555;
        }
        .problem-tab.active {
            background: #3498db;
            color: white;
        }

        /* ---- 题目答案显示 ---- */
        .problem-answer {
            background: #ecf0f1;
            padding: 12px 15px;
            border-radius: 8px;
            margin-bottom: 12px;
            line-height: 1.7;
            font-size: 0.95rem;
            border-left: 4px solid #2ecc71;
        }
        .problem-correct {
            border-left-color: #2ecc71;
            background: #f0fff4;
        }

        /* ---- 标记模式工具栏 ---- */
        .marker-controls {
            position: absolute;
            top: 8px;
            left: 8px;
            right: 8px;
            display: flex;
            gap: 6px;
            align-items: center;
            flex-wrap: wrap;
            background: rgba(255,255,255,0.92);
            padding: 8px 12px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.15);
            z-index: 50;
        }
        .marker-count {
            font-size: 0.85rem;
            font-weight: bold;
            color: #2c3e50;
            min-width: 70px;
        }
        .marker-tool-btn {
            padding: 5px 10px;
            font-size: 0.8rem;
            background: #ecf0f1;
            border: 1px solid #bdc3c7;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            color: #555;
        }
        .marker-tool-btn.active {
            background: #3498db;
            color: white;
            border-color: #2980b9;
        }
        .marker-size-input {
            width: 56px;
            padding: 5px 4px;
            font-size: 0.85rem;
            border: 1px solid #bdc3c7;
            border-radius: 5px;
            text-align: center;
        }
        .marker-action-btn {
            padding: 5px 8px;
            font-size: 0.8rem;
            border-radius: 5px;
            background: #e74c3c;
            color: white;
            border: none;
            cursor: pointer;
        }
        .marker-action-btn:hover {
            opacity: 0.85;
        }
        #marker-note {
            background: #2ecc71;
        }
        #marker-apply {
            background: #9b59b6;
        }
        #marker-clear {
            background: #e67e22;
        }
        #marker-select-confirm {
            background: #2c3e50;
            color: white;
        }
        .marker-tool-btn[data-tool="select"].active {
            background: #f1c40f;
            color: white;
            border-color: #f1c40f;
        }

        /* ---- 识别题目 ---- */
        #scan-preview {
            max-width: 100%;
            max-height: 320px;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin: 10px 0;
        }
        #scan-image-input {
            display: block;
            margin: 8px 0;
        }
        #scan-result {
            background: #ecf9f1;
            border: 1px solid #2ecc71;
            border-radius: 8px;
            padding: 10px;
            margin: 10px 0;
            font-size: 0.9rem;
            line-height: 1.8;
            color: #1a3c27;
            white-space: normal;
        }
        .scan-hint {
            font-size: 0.85rem;
            color: #666;
            line-height: 1.7;
            margin-bottom: 10px;
        }
        #marker-notes-toggle {
            background: #16a085;
        }

        /* ---- 定义模型（开发者模式） ---- */
        .geo-divider {
            border: 0;
            border-top: 1px solid #ddd;
            margin: 16px 0;
        }
        .define-row {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 10px;
        }
        .define-row input[type="file"] {
            flex: 1;
            min-width: 160px;
            font-size: 0.85rem;
        }
        #define-model-btn {
            background: #8e44ad;
            color: white;
            border: none;
            padding: 8px 14px;
            border-radius: 8px;
            cursor: pointer;
        }
        #define-model-btn:hover {
            opacity: 0.85;
        }
        #define-preview {
            max-width: 100%;
            max-height: 320px;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin: 8px 0;
            display: block;
        }

        /* ---- 模型编辑面板 ---- */
        #model-editor {
            position: fixed;
            left: 50%;
            bottom: 74px;
            transform: translateX(-50%);
            width: 520px;
            max-width: 94vw;
            background: #fff;
            border: 1px solid #8e44ad;
            border-radius: 12px;
            padding: 12px 14px;
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
            z-index: 60;
            font-size: 0.85rem;
        }
        #model-editor .me-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-weight: bold;
            color: #8e44ad;
            margin-bottom: 8px;
        }
        #model-editor #me-close {
            background: none;
            border: none;
            font-size: 1.2rem;
            cursor: pointer;
            color: #999;
        }
        #model-editor .me-row {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
            margin-bottom: 6px;
        }
        #model-editor label {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }
        #model-editor input[type="number"] {
            width: 64px;
            padding: 4px;
            border: 1px solid #ccc;
            border-radius: 5px;
            font-size: 0.85rem;
        }
        #model-editor #me-color {
            width: 46px;
            height: 30px;
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 2px;
        }
        #model-editor button {
            border: none;
            border-radius: 6px;
            padding: 6px 10px;
            cursor: pointer;
        }
        #me-note {
            background: #2ecc71;
            color: #fff;
        }
        #me-delete {
            background: #e74c3c;
            color: #fff;
        }
        #me-tip {
            color: #999;
            font-size: 0.78rem;
            margin-left: auto;
        }
        @media (max-width: 640px) {
            #model-editor {
                bottom: 130px;
                width: 96vw;
            }
            #model-editor input[type="number"] {
                width: 54px;
            }
        }

        /* ---- 备注编辑器 ---- */
        .note-editor label {
            display: block;
            font-weight: bold;
            margin-bottom: 6px;
            color: #2c3e50;
        }
        .note-editor textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 0.95rem;
            resize: vertical;
            margin-bottom: 12px;
            font-family: inherit;
        }
        .note-editor input[type="file"] {
            margin-bottom: 12px;
            font-size: 0.9rem;
        }
        .note-preview {
            display: block;
            max-width: 100%;
            max-height: 220px;
            border: 1px solid #ddd;
            border-radius: 8px;
            margin-bottom: 8px;
        }

        /* ---- 边数滑块 ---- */
        #sides-group {
            margin-bottom: 12px;
        }
        #sides-group input[type="range"] {
            width: 100%;
        }
        #sides-group span {
            font-weight: bold;
            color: #3498db;
        }

        /* ---- 2D 函数浮动画布 ---- */
        .plot2d-panel {
            position: fixed;
            right: 20px;
            bottom: 20px;
            width: 580px;
            max-width: 95vw;
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.25);
            z-index: 200;
            overflow: hidden;
        }
        .plot2d-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: #3498db;
            color: white;
            cursor: move;
            user-select: none;
            font-weight: bold;
            font-size: 0.9rem;
        }
        .plot2d-close {
            cursor: pointer;
            font-size: 1.2rem;
            line-height: 1;
        }
        #plot2d-canvas {
            display: block;
            width: 100%;
            height: auto;
            touch-action: none;
        }

        /* ---- 提示文字 ---- */
        .hint {
            margin-top: 10px;
            font-size: 0.8rem;
            color: #999;
        }

        /* ---- 位置/旋转行列 ---- */
        .geo-num-row .control-group {
            margin-bottom: 0;
        }

        /* ---- 响应式 ---- */
        @media (max-width: 1200px) {
            .container {
                flex-direction: column;
                align-items: center;
            }
            .controls, .visualization {
                max-width: 100%;
            }
            .visualization {
                height: 500px;
            }
            #cube-container {
                height: 400px;
            }
            .social-bar {
                flex-direction: column;
                gap: 15px;
                text-align: center;
            }
        }
        @media (max-width: 768px) {
            .header h1 {
                font-size: 1.8rem;
            }
            .controls {
                padding: 15px;
            }
            .slider-container {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }
            input[type="range"] {
                width: 100%;
            }
            .buttons {
                flex-direction: column;
            }
            .volume-display {
                font-size: 1.2rem;
            }
            .geometry-selector {
                grid-template-columns: 1fr;
            }
            .common-functions {
                grid-template-columns: 1fr;
            }
        }
