        html,
        body {
            margin: 0;
            padding: 0;
            height: 100vh;
            background: beige;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-family: "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
            scale: 1;
        }

        #badgeContainer {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 30vh;
            height: 46vh;
        }

        .badge {
            width: 30vh;
            height: 46vh;
            background: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            overflow: hidden;
            z-index: 2;
            box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.15);
        }

        .badge.dragover {
            box-shadow: 0 0 1vh 0.5vh #999;
        }

        .photo-frame {
            width: 15vh;
            height: 19vh;
            top: 4vh;
            background: #cccccc;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            cursor: pointer;
            overflow: hidden;
            transition: background 0.3s ease;
        }

        .photo-frame.filled {
            background: white;
        }

        .photo-frame img {
            height: 100%;
            width: auto;
            object-fit: contain;
            display: block;
            margin: 0 auto;
        }


        #frame {
            position: relative;
            z-index: 3;
            /* 确保高于 canvas */
        }

        #iconCanvas {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
        }

        .photo-frame input[type="file"] {
            position: absolute;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
        }

        .info {
            flex: 1;
            justify-content: flex-start;
            padding-top: 6vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            box-sizing: border-box;
        }

        .info {
            position: relative;
            z-index: 9;
            pointer-events: none;
            /* ✅ 页面交互时可禁用，但截图前会临时启用 */
            opacity: 1;
            visibility: visible;
        }

        .line {
            font-size: 2.2vh;
            color: #000000;
            margin: 1.8vh 0;
            text-align: center;
            font-family: "Noto Sans", "Microsoft YaHei", sans-serif;
        }

        .line.name {
            font-size: 2.5vh;
            font-weight: bold;
            color: #000000;
        }

        .loadBtn {
            margin-top: 2vh;
            font-size: 2vh;
            padding: 1vh 2vh;
            cursor: pointer;
            display: inline-block;
            background-color: #f0f0f0;
            border: 1px solid #ccc;
            border-radius: 0.5vh;
            font-family: inherit;
            text-align: center;
            transition: background 0.3s ease;
        }

        .loadBtn:hover {
            background-color: #e0e0e0;
        }

        .controlGroup {
            position: fixed;
            display: flex;
            flex-direction: column;
            gap: 0.5vh;
            z-index: 20;
        }

        .sceneLoaderPanel {
            position: fixed;
            display: flex;
            flex-direction: column;
            gap: 0.5vh;
            z-index: 20;
        }

        .controlGroup button {
            padding: 1.2vh 1.2vw;
            font-size: 1.2vh;
            padding: 1vh 1.5vh;
            cursor: pointer;
            background-color: #fff;
            border: 1px solid #ccc;
            transition: background-color 0.3s;
        }

        .sceneLoaderPanel button {
            padding: 1.2vh 1.2vw;
            font-size: 1.2vh;
            padding: 1vh 1.5vh;
            cursor: pointer;
            background-color: #fff;
            border: 1px solid #ccc;
            transition: background-color 0.3s;
        }

        .sceneLoaderPanel button {
            border-radius: 0.4vh;
        }

        .controlGroup button {
            border-radius: 50%;
        }

        .controlGroup button:hover {
            background-color: #eee;
        }

        .sceneLoaderPanel button:hover {
            background-color: #eee;
        }



        /* 📱 竖屏优化 */
        @media screen and (orientation: portrait) {
            canvas {
                width: 90vw;
                height: calc(90vw / 1.2);
                /* 更适合竖屏比例 */
            }

            .controlGroup {
                top: 10vh;
            }

            .sceneLoaderPanel {
                top: 10vh;
            }

            .controlGroup {
                right: 0cm;
            }

            .sceneLoaderPanel {
                left: -3vw;
            }
        }

        /* 💻 横屏优化 */
        @media screen and (orientation: landscape) {
            canvas {
                width: 80vw;
                height: calc(80vw / 1.78);
                /* 横屏16:9 */
            }

            .controlGroup {
                top: 10vh;
            }

            .sceneLoaderPanel {
                top: 10vh;
            }

            .controlGroup {
                right: 0vw;
            }

            .sceneLoaderPanel {
                left: -3vw;
            }
        }

        button {
            margin-top: 1vh;
            /* ✅ 缩小垂直间距 */
            font-size: 1.6vh;
            /* ✅ 缩小字体 */
            padding: 0.6vh 1.2vh;
            /* ✅ 缩小内边距 */
            cursor: pointer;
        }


        .buttonRow {
            display: flex;
            flex-wrap: wrap;
            gap: 0.6vh;
            /* ✅ 缩小按钮之间的间距 */
            margin-top: 2vh;
            /* ✅ 缩小每组按钮之间的间距 */
        }


        .buttonRow>* {
            flex: 1 1 calc(33.333% - 0.6vh);
            min-width: 100px;
            box-sizing: border-box;
        }

        .actionBtn {
            display: inline-block;
            text-align: center;
            font-size: 2vh;
            padding: 0.6vh 1.2vh;
            background-color: #fff;
            border: 1px solid #ccc;
            border-radius: 0.5vh;
            cursor: pointer;
            transition: background-color 0.3s ease;
            width: 100%;
            /* ✅ 让每个按钮填满所在列 */
            box-sizing: border-box;
        }

        .actionBtn {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        #consolePanel {
            position: fixed;
            bottom: 2vh;
            left: 0;
            width: 100%;
            max-height: 20vh;
            overflow-y: auto;
            background: #111;
            color: #0f0;
            font-family: monospace;
            font-size: 1.4vh;
            padding: 1vh;
            box-sizing: border-box;
            z-index: 999;
            border-top: 1px solid #444;
        }