/* ============================================================================
 * style.css - GENERATED CSS BUNDLE
 * Source modules and order: see src/css/README.md.
 * Rebuild with: npm run build:css
 * ========================================================================== */

:root {

            --primary: #ff66aa;
            --primary-light: #ff8cb9;
            --primary-dark: #e0548b;
            --primary-deep: #b3396d;
            --primary-glow: rgba(255, 102, 170, 0.35);

            --bg-stage: #14121a;
            --bg-dialog: #181520;
            --bg-dark: #18171c;
            --bg-dark-secondary: #222028;
            --bg-surface: rgba(34, 32, 40, 0.85);
            --bg-surface-elevated: #2a2734;
            --panel-bg: rgba(26, 24, 32, 0.92);

            --text-main: #ffffff;
            --text-secondary: #c8c6d1;
            --text-muted: #8d8a99;

            --border-subtle: rgba(255, 255, 255, 0.08);
            --border-medium: rgba(255, 255, 255, 0.14);
            --border-pink: rgba(255, 102, 170, 0.4);

            /* ===== 通用扁平按钮语义变量 (Flat Minimalist Buttons) ===== */
            --btn-bg: rgba(255, 255, 255, 0.12);
            --btn-bg-subtle: rgba(255, 255, 255, 0.08);
            --btn-hover-bg: #ffffff;
            --btn-hover-text: #111118;
            --btn-active-bg: #e2e2e8;

            /* ===== 现代化简洁无衬线数字与英文字体规范 (Tabular-nums / Clean Modern Sans) ===== */
            --font-clean: "Torus", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        *, *::before, *::after {
            box-sizing: border-box;
        }

        body {
            font-family: var(--font-clean);
            background: var(--bg-stage) !important;
            color: var(--text-main);
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
            position: relative;
        }

        #bg-overlay,
        #bg-image {
            display: none !important;
        }

        * {
            scrollbar-width: thin;
            scrollbar-color: rgba(224, 84, 139, 0.5) rgba(0, 0, 0, 0.25);
        }

        ::-webkit-scrollbar {
            width: 7px;
            height: 7px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            transition: background 0.15s ease;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.38);
            box-shadow: none;
        }

        ::-webkit-scrollbar-corner {
            background: transparent;
        }

        h1 {
            font-size: 1.5rem;
            margin: 0 0 10px 0;
            color: var(--primary);
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
            text-align: center;
            width: 100%;
        }

        /* 全局滑动条重置：彻底消除边距和内边距，保证滑块能拉到最左端(最低)和最右端(到头) */
        input[type="range"] {
            padding: 0 !important;
            margin: 0;
            border: none !important;
            outline: none;
            background: transparent;
            box-sizing: border-box;
        }


        /* ===== 共享弹窗与菜单动效 ===== */
        @keyframes modalScaleUp {
            from { opacity: 0; transform: scale(0.97) translateY(8px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        @keyframes modalScaleDown {
            from { opacity: 1; transform: scale(1) translateY(0); }
            to { opacity: 0; transform: scale(0.97) translateY(8px); }
        }

        @keyframes fadeInDown {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes dropdownMenuFadeIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ===== 统一通用按钮规范 (Flat Minimalist Buttons) ===== */
        .btn,
        .btn-primary,
        .btn-secondary,
        .btn-danger {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 7px 15px;
            border-radius: 6px;
            font-size: 0.82rem;
            font-weight: 500;
            cursor: pointer;
            border: none;
            background: var(--btn-bg);
            color: rgba(255, 255, 255, 0.9);
            transition: all 0.15s ease;
            user-select: none;
            white-space: nowrap;
            text-decoration: none;
            line-height: 1.3;
            box-shadow: none !important;
        }

        .btn-icon {
            background: var(--btn-bg-subtle);
            border: none;
            color: rgba(255, 255, 255, 0.75);
            width: 26px;
            height: 26px;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.82rem;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            box-shadow: none;
        }

        /* 全站分散按钮的统一扁平化交互基线 (悬浮纯白底黑字 / 点击 scale(0.96) / 禁用 0.45) */
        .btn,
        .btn-primary,
        .btn-secondary,
        .btn-danger,
        .btn-icon,
        .tool-btn,
        .play-pause-btn,
        .fullscreen-btn,
        .startup-action {
            border: none;
            box-shadow: none;
        }

        .btn:not(:disabled):not([style*="not-allowed"]):hover,
        .btn-primary:not(:disabled):not([style*="not-allowed"]):hover,
        .btn-secondary:not(:disabled):not([style*="not-allowed"]):hover,
        .btn-danger:not(:disabled):not([style*="not-allowed"]):hover,
        .btn-icon:not(:disabled):not([style*="not-allowed"]):hover,
        .tool-btn:not(:disabled):not([style*="not-allowed"]):hover,
        .play-pause-btn:not(:disabled):not([style*="not-allowed"]):hover,
        .fullscreen-btn:not(:disabled):not([style*="not-allowed"]):hover,
        .startup-action:not(:disabled):hover {
            background: var(--btn-hover-bg) !important;
            color: var(--btn-hover-text) !important;
            border: none;
            box-shadow: none !important;
            transform: none !important;
        }

        .btn:not(:disabled):not([style*="not-allowed"]):active,
        .btn-primary:not(:disabled):not([style*="not-allowed"]):active,
        .btn-secondary:not(:disabled):not([style*="not-allowed"]):active,
        .btn-danger:not(:disabled):not([style*="not-allowed"]):active,
        .btn-icon:not(:disabled):not([style*="not-allowed"]):active,
        .tool-btn:not(:disabled):not([style*="not-allowed"]):active,
        .play-pause-btn:not(:disabled):not([style*="not-allowed"]):active,
        .fullscreen-btn:not(:disabled):not([style*="not-allowed"]):active,
        .startup-action:not(:disabled):active {
            transform: scale(0.96) !important;
            background: var(--btn-active-bg) !important;
            color: var(--btn-hover-text) !important;
        }

        .btn:disabled,
        .btn[disabled],
        .btn-primary:disabled,
        .btn-primary[disabled],
        .btn-secondary:disabled,
        .btn-secondary[disabled],
        .btn-danger:disabled,
        .btn-danger[disabled],
        .btn-icon:disabled,
        .tool-btn:disabled,
        .tool-btn[style*="not-allowed"] {
            opacity: 0.45 !important;
            cursor: not-allowed !important;
            pointer-events: none !important;
            box-shadow: none !important;
            background: var(--btn-bg) !important;
            color: rgba(255, 255, 255, 0.9) !important;
            transform: none !important;
        }

        /* ===== 统一细长滚动条 ===== */
        #diffMenu::-webkit-scrollbar,
        .left-info-panel::-webkit-scrollbar {
            width: 5px;
        }

        #diffMenu::-webkit-scrollbar-thumb,
        .left-info-panel::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.18);
            border-radius: 3px;
        }

        /* ===== 统一滑块样式 (粉色进度轨道 + 白色圆点滑块) ===== */
        .tweak-slider-item input[type="range"],
        .texture-image-range,
        .player-controls .progress-slider,
        .player-controls .volume-slider {
            -webkit-appearance: none !important;
            appearance: none !important;
            height: 4px !important;
            border-radius: 2px !important;
            background: linear-gradient(
                to right,
                var(--primary) 0%,
                var(--primary) var(--slider-pct, 0%),
                rgba(255, 255, 255, 0.2) var(--slider-pct, 0%),
                rgba(255, 255, 255, 0.2) 100%
            ) !important;
            outline: none !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            margin: 0 !important;
            cursor: pointer !important;
        }

        .tweak-slider-item input[type="range"]::-webkit-slider-runnable-track,
        .texture-image-range::-webkit-slider-runnable-track,
        .player-controls .progress-slider::-webkit-slider-runnable-track,
        .player-controls .volume-slider::-webkit-slider-runnable-track {
            height: 4px !important;
            border-radius: 2px !important;
            background: transparent !important;
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            margin: 0 !important;
        }

        .tweak-slider-item input[type="range"]::-moz-range-track,
        .texture-image-range::-moz-range-track,
        .player-controls .progress-slider::-moz-range-track,
        .player-controls .volume-slider::-moz-range-track {
            height: 4px !important;
            border-radius: 2px !important;
            background: transparent !important;
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            margin: 0 !important;
        }

        .tweak-slider-item input[type="range"]::-webkit-slider-thumb,
        .texture-image-range::-webkit-slider-thumb,
        .player-controls .progress-slider::-webkit-slider-thumb,
        .player-controls .volume-slider::-webkit-slider-thumb {
            -webkit-appearance: none !important;
            appearance: none !important;
            width: 10px !important;
            height: 10px !important;
            border-radius: 50% !important;
            background: var(--text-main) !important;
            border: none !important;
            box-shadow: none !important;
            cursor: pointer !important;
            margin-top: -3px !important;
            transition: transform 0.15s ease;
        }

        .tweak-slider-item input[type="range"]::-moz-range-thumb,
        .texture-image-range::-moz-range-thumb,
        .player-controls .progress-slider::-moz-range-thumb,
        .player-controls .volume-slider::-moz-range-thumb {
            width: 10px !important;
            height: 10px !important;
            border-radius: 50% !important;
            background: var(--text-main) !important;
            border: none !important;
            box-shadow: none !important;
            cursor: pointer !important;
            transition: transform 0.15s ease;
        }

        .tweak-slider-item input[type="range"]::-webkit-slider-thumb:hover,
        .texture-image-range::-webkit-slider-thumb:hover {
            transform: scale(1.25);
        }

        .tweak-slider-item input[type="range"]::-moz-range-thumb:hover,
        .texture-image-range::-moz-range-thumb:hover {
            transform: scale(1.25);
        }

        /* ===== 统一透明棋盘格底纹 ===== */

        /* ===== 统一居中弹窗容器与遮罩层 ===== */
        .texture-image-scope-modal {
            position: fixed;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .texture-image-scope-backdrop {
            position: absolute;
            inset: 0;
        }

        /* ===== 统一切换开关基础样式 ===== */


        /* ===== 现代化全功能底栏播放器控制台 (Studio Docked Player Bar) ===== */
        .player-controls.studio-bottom-bar {
            flex-direction: column;
            gap: 6px;
            margin: 0;
            padding: 6px 24px 8px 24px;
            background: var(--bg-stage) !important;
            backdrop-filter: blur(16px);
            border-top: 1px solid var(--border-subtle);
            border-left: none !important;
            border-right: none !important;
            border-bottom: none !important;
            border-radius: 0;
            box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.4);
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            flex-shrink: 0 !important;
            z-index: 30;
            position: relative;
            overflow: visible;
            transition: opacity 0.3s ease, filter 0.3s ease;
        }

        .player-controls.disabled {
            opacity: 0.4;
            pointer-events: none;
            filter: grayscale(0.5);
            cursor: not-allowed;
        }

        /* 进度条与时间行 (紧凑横排) */
        .studio-bottom-bar .progress-section {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
            width: 100%;
        }

        .studio-bottom-bar .time-label {
            font-size: 0.8rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.88);
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.3px;
            font-family: var(--font-clean);
            flex-shrink: 0;
            min-width: 44px;
            text-align: center;
        }

        .studio-bottom-bar .slider-wrapper {
            flex: 1;
            position: relative;
            height: 14px;
            display: flex;
            align-items: center;
        }

        /* 底层控制 Deck：播放、调节与数据 */
        .studio-bottom-bar .controls-action-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            width: 100%;
            flex-wrap: wrap;
        }

        .deck-group {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .deck-playback {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .deck-playback .play-pause-btn {
            width: 36px;
            height: 36px;
        }

        .deck-divider {
            width: 1px;
            height: 20px;
            background: var(--border-subtle);
            flex-shrink: 0;
        }

        /* 中区流速与背景暗化调节 */
        .deck-tweaks {
            display: flex;
            align-items: center;
            gap: 12px;
            justify-content: flex-end;
            flex-wrap: nowrap;
            margin-left: auto;
            overflow: visible;
        }

        @media (prefers-reduced-motion: reduce) {

        }

        .tweak-slider-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(0, 0, 0, 0.45);
            padding: 3px 10px;
            border-radius: 6px;
            border: none !important;
            height: 30px;
            box-sizing: border-box;
        }

        .tweak-label {
            font-size: 0.76rem;
            font-weight: 600;
            color: var(--text-secondary);
            user-select: none;
            white-space: nowrap;
        }

        .tweak-slider-item input[type="range"] {
            width: 70px !important;
            --slider-pct: 50%;
        }

        #speedRange {
            --slider-pct: 40%;
        }

        #dimRange {
            --slider-pct: 80%;
        }

        .tweak-val {
            font-size: 0.76rem;
            font-weight: 700;
            color: var(--primary-light);
            min-width: 32px;
            text-align: right;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.2px;
            font-family: var(--font-clean);
        }

        /* 右区横向谱面统计徽章 */

        .time-label {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-main);
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.3px;
            font-family: var(--font-clean);
        }

        .slider-wrapper {
            position: relative;
            width: 100%;
            height: 16px;
            display: flex;
            align-items: center;
        }

        .progress-slider {
            width: 100% !important;
            --slider-pct: 0%;
        }

        .progress-slider:disabled {
            cursor: not-allowed !important;
            opacity: 0.6 !important;
        }

        /* 控制按键与音量行 */
        .controls-action-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        /* 播放/暂停圆形大按键 */
        .play-pause-btn {
            width: 44px;
            height: 44px;
            flex-shrink: 0;
            padding: 0;
            border-radius: 50%;
            border: none;
            background: var(--btn-bg);
            color: var(--text-main);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: none;
            transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
        }

        .play-pause-btn svg {
            width: 20px;
            height: 20px;
        }

        .play-pause-btn .play-icon {
            display: block;
            margin-left: 2px;
        }

        .play-pause-btn .pause-icon {
            display: none;
        }

        .play-pause-btn.playing .play-icon {
            display: none;
        }

        .play-pause-btn.playing .pause-icon {
            display: block;
            margin-left: 0;
        }

        /* 音量控件 */
        .volume-mixer {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
            width: 340px;
            min-width: 300px;
            flex: 0 1 340px;
        }

        .volume-control {
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 1 1 0;
            min-width: 0;
            padding: 0;
            background: transparent;
            border-radius: 0;
            border: none;
        }

        .volume-label {
            color: var(--text-muted);
            font-size: 0.68rem;
            font-weight: 600;
            line-height: 1;
            flex: 0 0 24px;
            user-select: none;
        }

        .volume-mute-btn {
            background: transparent;
            border: none;
            color: var(--text-main);
            padding: 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: none;
            flex: 0 0 20px;
            transition: transform 0.15s ease, opacity 0.15s ease;
        }

        .volume-mute-btn:hover {
            transform: scale(1.15);
            opacity: 0.9;
        }

        .volume-mute-btn svg {
            width: 14px;
            height: 14px;
        }

        .volume-mute-btn .vol-icon {
            display: block;
        }

        .volume-mute-btn .mute-icon {
            display: none;
        }

        .volume-mute-btn.muted .vol-icon {
            display: none;
        }

        .volume-mute-btn.muted .mute-icon {
            display: block;
            color: #ff789c;
        }

        .volume-slider {
            flex: 1 !important;
            min-width: 0 !important;
            --slider-pct: 80%;
        }

        .volume-percent {
            font-size: 0.7rem;
            color: var(--text-main);
            min-width: 28px;
            text-align: right;
            font-family: var(--font-clean);
            font-variant-numeric: tabular-nums;
            font-weight: 600;
        }

        @media (max-width: 720px) {
            .volume-mixer {
                gap: 8px;
                width: 292px;
                min-width: 264px;
                flex-basis: 292px;
            }

            .volume-label {
                flex-basis: 22px;
                font-size: 0.64rem;
            }

            .volume-percent {
                display: none;
            }
        }

        .player-container {
            flex: 1;
            min-width: 0;
            width: 100%;
            height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: space-between;
            padding: 0;
            position: relative;
            box-sizing: border-box;
            overflow: hidden;
            background: var(--bg-stage) !important;
        }


        /* ===== 画布顶部工具栏 (整合品牌、导入与工具) ===== */
        .canvas-top-bar {
            width: 100%;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 0 12px;
            background: var(--bg-stage) !important;
            backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border-subtle);
            box-sizing: border-box;
            flex-shrink: 0;
            z-index: 100;
            overflow: visible !important;
        }

        .canvas-top-bar::-webkit-scrollbar {
            display: none;
        }

        .canvas-top-tools-left {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
            flex-wrap: nowrap;
        }

        .canvas-top-tools-right {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
            flex-wrap: nowrap;
        }

        /* 顶部导入按钮 */
        .topbar-file-item {
            display: flex;
            align-items: center;
            gap: 6px;
            position: relative;
        }

        .topbar-file-item input[type="file"] {
            display: none;
        }

        .topbar-file-dropdown .dropdown-menu {
            min-width: 282px;
        }

        .topbar-file-dropdown input[type="file"] {
            display: none;
        }

        .topbar-file-dropdown .topbar-file-item {
            width: 100%;
        }

        .topbar-file-item.disabled {
            opacity: 0.5;
            pointer-events: none;
        }

        /* 顶部难度选择器一体化下拉菜单 */
        #diffDropdownWrapper {
            position: relative;
            flex: 0 0 auto;
            z-index: 101;
        }

        #diffSelectBtn {
            height: 32px;
            padding: 0 10px;
            max-width: 240px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        #diffSelectLabel {
            max-width: 175px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: inline-block;
            vertical-align: middle;
        }

        #diffMenu {
            min-width: 280px;
            max-width: 360px;
            max-height: 420px;
            overflow-y: auto;
        }

        .diff-badge-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.72rem;
            font-weight: 700;
            padding: 2px 6px;
            background: var(--btn-bg-subtle);
            border: none;
            border-radius: 5px;
            color: var(--text-main);
            min-width: 28px;
            height: 22px;
            box-sizing: border-box;
            transition: all 0.15s ease;
        }

        .dropdown-item:hover .diff-badge-icon {
            color: var(--primary);
        }

        .dropdown-item.active {
            background: rgba(255, 102, 170, 0.16);
            box-shadow: inset 0 0 0 1px var(--border-pink);
        }

        .dropdown-item.active .title {
            color: var(--primary);
        }

        .dropdown-item.active .diff-badge-icon {
            background: var(--primary);
            color: var(--text-main);
        }

        /* 顶部工具按钮布局 */
        .canvas-top-bar .tool-btn {
            flex: 0 0 auto;
            height: 32px;
            padding: 0 9px;
            font-size: 0.8rem;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            border-radius: 6px;
            box-sizing: border-box;
        }

        .canvas-top-bar .dropdown-wrapper {
            flex: 0 0 auto;
            position: relative;
            z-index: 101;
        }

        .canvas-top-tools-right .dropdown-menu {
            left: auto;
            right: 0;
        }

        .language-select {
            appearance: none;
            -webkit-appearance: none;
            flex: 0 0 auto;
            min-width: 108px;
            height: 30px;
            padding: 0 30px 0 11px;
            border: none;
            border-radius: 8px;
            outline: none;
            background: var(--btn-bg);
            color: var(--text-main);
            font: inherit;
            font-size: 0.74rem;
            font-weight: 600;
            cursor: pointer;
            box-shadow: none;
            color-scheme: dark;
            transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
        }

        .language-select:hover,
        .language-select:focus-visible {
            background: var(--btn-hover-bg);
            color: var(--btn-hover-text);
            box-shadow: none;
        }

        .language-select:active {
            transform: scale(0.96);
            background: var(--btn-active-bg);
        }

        .language-select option {
            background: var(--bg-dark-secondary);
            color: var(--text-main);
        }

        /* ===== 主舞台区域 (左侧信息栏与画布同级水平排布，保证画布永不被遮挡) ===== */
        .player-main-area {
            display: flex;
            flex-direction: row;
            align-items: stretch;
            width: 100%;
            flex: 1 1 auto;
            min-height: 0;
            position: relative;
            overflow: hidden;
            background: var(--bg-stage) !important;
        }

        /* ===== 左侧资源信息面板 (纵向排列，独立占据画布左侧区域) ===== */
        .left-info-panel {
            position: relative;
            width: 220px;
            height: 100%;
            flex-shrink: 0;
            overflow-y: auto;
            overflow-x: hidden;
            z-index: 10;
            background: var(--bg-stage) !important;
            border: none;
            border-right: 1px solid var(--border-subtle);
            border-radius: 0;
            padding: 14px 14px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            box-shadow: none;
            box-sizing: border-box;
            user-select: none;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
        }

        .left-info-panel .info-section {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 5px;
            width: 100%;
            box-sizing: border-box;
        }

        .left-info-panel .info-section + .info-section {
            padding-top: 10px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
        }

        .info-section-tag {
            font-size: 0.74rem;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.5);
            letter-spacing: 0.8px;
            text-transform: uppercase;
        }

        .info-main-title {
            font-size: 0.94rem;
            font-weight: 700;
            color: var(--text-main);
            line-height: 1.35;
            width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .info-sub-title {
            font-size: 0.82rem;
            color: rgba(255, 255, 255, 0.65);
            line-height: 1.35;
            width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .info-meta-text {
            font-size: 0.76rem;
            color: rgba(255, 255, 255, 0.45);
            margin-top: 1px;
            width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .diff-stats-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 100%;
            margin-top: 4px;
            box-sizing: border-box;
        }

        .diff-stat-card {
            background: rgba(0, 0, 0, 0.32);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 5px;
            padding: 6px 10px;
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            width: 100%;
            box-sizing: border-box;
            transition: background 0.15s ease;
        }

        .diff-stat-card:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .diff-stat-lbl {
            font-size: 0.78rem;
            color: rgba(255, 255, 255, 0.5);
            font-weight: 500;
            flex-shrink: 0;
            font-family: var(--font-clean);
        }

        .diff-stat-val {
            font-size: 0.88rem;
            color: var(--text-main);
            font-weight: 700;
            font-family: var(--font-clean);
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.2px;
            max-width: 125px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: right;
        }

        /* 全屏时隐藏左侧面板 */
        .canvas-wrapper:fullscreen ~ .left-info-panel,
        .canvas-wrapper:-webkit-full-screen ~ .left-info-panel,
        :fullscreen .left-info-panel,
        .player-main-area:has(:fullscreen) .left-info-panel {
            display: none !important;
        }

        .canvas-wrapper {
            position: relative;
            flex: 0 1 auto;
            aspect-ratio: 16 / 9;
            height: calc(100% - 24px);
            max-height: calc(100vh - 128px);
            max-width: calc(100vw - 244px);
            margin: auto;
            display: flex;
            justify-content: center;
            align-items: center;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 4px 28px rgba(0, 0, 0, 0.55);
            background: #000 !important;
        }

        .canvas-wrapper:fullscreen,
        .canvas-wrapper:-webkit-full-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            max-width: 100vw;
            max-height: 100vh;
            aspect-ratio: unset;
            border-radius: 0;
            box-shadow: none;
            background: #000;
            z-index: 99999;
        }


        /* ===== 启动选择面板 (谱面 / 资源包) ===== */
        .startup-actions {
            position: absolute;
            inset: 0;
            z-index: 4;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 28px;
            box-sizing: border-box;
            overflow: auto;
            background: rgba(8, 7, 12, 0.48);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
        }

        .startup-actions[hidden] {
            display: none !important;
        }

        .startup-actions-content {
            width: min(500px, 100%);
            display: flex;
            flex-direction: column;
            align-items: stretch;
            transition: transform 0.18s ease;
        }

        .startup-action {
            width: 100%;
            min-height: 86px;
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 16px 20px;
            border: none;
            border-radius: 8px;
            background: var(--btn-bg);
            color: var(--text-main);
            text-align: left;
            cursor: pointer;
            box-shadow: none;
            transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
            box-sizing: border-box;
        }

        .startup-action:hover .startup-action-title,
        .startup-action:hover .startup-action-desc,
        .startup-action:focus-visible .startup-action-title,
        .startup-action:focus-visible .startup-action-desc {
            color: var(--btn-hover-text);
        }

        .startup-action:hover .startup-action-icon,
        .startup-action:focus-visible .startup-action-icon {
            color: var(--btn-hover-text);
            background: rgba(17, 17, 24, 0.1);
        }

        .startup-action-separator {
            height: 28px;
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            padding: 0 28px;
        }

        .startup-action-separator span {
            width: 100%;
            height: 1px;
            background: linear-gradient(
                to right,
                transparent,
                rgba(255, 255, 255, 0.28) 18%,
                rgba(255, 255, 255, 0.28) 82%,
                transparent
            );
        }

        .startup-action-default {
            margin-top: 10px;
            background: rgba(255, 255, 255, 0.08);
        }

        .startup-action-icon {
            width: 46px;
            height: 46px;
            flex: 0 0 46px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.08);
            color: var(--primary-light);
            transition: background 0.15s ease, color 0.15s ease;
        }

        .startup-action-skin .startup-action-icon {
            color: var(--text-main);
        }

        .startup-action-default .startup-action-icon {
            color: #a9d7ff;
        }

        .startup-action-icon svg {
            width: 25px;
            height: 25px;
        }

        .startup-action-copy {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .startup-action-title {
            font-size: 1rem;
            font-weight: 700;
            line-height: 1.3;
        }

        .startup-action-desc {
            font-size: 0.78rem;
            line-height: 1.45;
            color: var(--text-secondary);
        }

        .startup-actions.is-dragging .startup-actions-content {
            transform: scale(1.015);
        }

        .startup-actions.is-dragging .startup-action {
            background: rgba(255, 102, 170, 0.18);
            box-shadow: inset 0 0 0 2px var(--border-pink);
        }

        /* ===== 全屏悬浮按钮 ===== */
        .fullscreen-btn {
            position: absolute;
            bottom: 14px;
            right: 14px;
            width: 38px;
            height: 38px;
            border-radius: 10px;
            background: rgba(20, 16, 32, 0.65);
            border: none;
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
            backdrop-filter: blur(8px);
            opacity: 0.45;
            transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
            box-shadow: none;
            padding: 0;
            flex: none;
        }

        .canvas-wrapper:hover .fullscreen-btn {
            opacity: 0.85;
        }

        .fullscreen-btn:hover {
            opacity: 1 !important;
        }

        .fullscreen-btn svg {
            width: 19px;
            height: 19px;
            transition: transform 0.2s ease;
            pointer-events: none;
        }

        .fullscreen-btn .exit-icon {
            display: none;
        }

        .canvas-wrapper:fullscreen .fullscreen-btn .enter-icon,
        .canvas-wrapper:-webkit-full-screen .fullscreen-btn .enter-icon {
            display: none;
        }

        .canvas-wrapper:fullscreen .fullscreen-btn .exit-icon,
        .canvas-wrapper:-webkit-full-screen .fullscreen-btn .exit-icon {
            display: block;
        }

        canvas {
            background: #000;
            width: 100%;
            height: 100%;
            display: block;
            transition: filter 0.3s ease;
        }

        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            background: rgba(15, 12, 41, 0.35);
            backdrop-filter: blur(4px);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.25s ease;
            z-index: 5;
        }

        .loading-overlay.active {
            opacity: 1;
            pointer-events: all;
        }

        .loading-card {
            width: 380px;
            background: var(--panel-bg);
            border: none;
            border-radius: 12px;
            padding: 24px 28px;
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.68);
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .loading-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .loading-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-main);
            letter-spacing: 0.5px;
        }

        .loading-percent {
            font-size: 0.95rem;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.9);
            font-family: var(--font-clean);
            font-variant-numeric: tabular-nums;
        }

        .progress-bar-bg {
            width: 100%;
            height: 8px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }

        .progress-bar-fill {
            height: 100%;
            width: 0%;
            background: rgba(255, 255, 255, 0.85);
            border-radius: 4px;
            transition: width 0.15s ease-out;
            box-shadow: none;
        }

        .loading-file-text {
            font-size: 0.8rem;
            color: var(--text-main);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-family: var(--font-clean);
        }

        .toast-container {
            position: fixed;
            top: 56px;
            right: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 99999;
            pointer-events: none;
            max-width: calc(100vw - 32px);
        }

        .toast {
            min-width: 200px;
            max-width: 320px;
            background: var(--panel-bg);
            border: none;
            border-left: 3px solid var(--primary);
            border-radius: 8px;
            padding: 8px 12px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(16px);
            color: var(--text-main);
            font-size: 0.78rem;
            transform: translateX(120%);
            opacity: 0;
            transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
            pointer-events: none;
            box-sizing: border-box;
        }

        .toast.show {
            transform: translateX(0);
            opacity: 1;
        }

        .toast.error {
            border-left-color: #ff4d6d;
        }

        .toast.error .toast-title {
            color: #ff4d6d;
        }

        .toast.success {
            border-left-color: #55e6a5;
        }

        .toast.success .toast-title {
            color: #55e6a5;
        }

        .toast-title {
            font-size: 0.76rem;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 6px;
            line-height: 1.2;
        }

        .toast-title svg {
            width: 13px;
            height: 13px;
            flex-shrink: 0;
            stroke-width: 2.2;
        }

        .toast-close-btn {
            margin-left: auto;
            pointer-events: auto;
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-size: 0.95rem;
            line-height: 1;
            cursor: pointer;
            padding: 2px 4px;
            border-radius: 4px;
            transition: color 0.15s, background-color 0.15s, transform 0.15s;
        }

        .toast-close-btn:hover {
            color: var(--btn-hover-text);
            background: var(--btn-hover-bg);
        }

        .toast-close-btn:active {
            transform: scale(0.96);
            background: var(--btn-active-bg);
        }

        .toast-msg {
            color: var(--text-secondary);
            line-height: 1.35;
            font-size: 0.72rem;
            word-break: break-word;
        }


        .tool-btn {
            flex: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 7px 13px;
            border-radius: 6px;
            font-size: 0.82rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            border: none;
            background: var(--btn-bg);
            color: rgba(255, 255, 255, 0.9);
            user-select: none;
            white-space: nowrap;
        }

        .tool-btn svg {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
        }

        .dropdown-wrapper.open .tool-btn {
            background: var(--btn-hover-bg);
            color: var(--btn-hover-text);
            box-shadow: none;
        }

        /* 导出下拉菜单 */
        .dropdown-wrapper {
            position: relative;
            flex: 1;
            display: flex;
        }

        .dropdown-wrapper .tool-btn {
            width: 100%;
        }

        .dropdown-menu {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            width: max-content;
            min-width: 260px;
            background: var(--panel-bg);
            backdrop-filter: blur(16px);
            border: none;
            border-radius: 10px;
            padding: 6px;
            display: none;
            flex-direction: column;
            gap: 4px;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.78);
            z-index: 1000;
            animation: fadeInDown 0.18s ease-out;
        }

        .dropdown-wrapper.open .dropdown-menu {
            display: flex;
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: var(--text-main);
            cursor: pointer;
            text-align: left;
            transition: all 0.15s ease;
            width: 100%;
        }

        .dropdown-item:hover {
            background: rgba(224, 84, 139, 0.2);
        }

        .dropdown-item:disabled,
        .dropdown-item[disabled] {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .dropdown-item:disabled:hover,
        .dropdown-item[disabled]:hover {
            background: transparent;
        }

        .dropdown-item .icon {
            font-size: 1.1rem;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
        }

        .dropdown-item .item-text {
            display: flex;
            flex-direction: column;
        }

        .dropdown-item .title {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .dropdown-item .desc {
            font-size: 0.7rem;
            color: var(--text-secondary);
            margin-top: 1px;
        }

        .skin-editor-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 2000;
            display: none;
            pointer-events: none;
        }

        .skin-editor-modal.active,
        .skin-editor-modal.is-closing {
            display: block;
        }

        .skin-editor-modal.is-closing {
            pointer-events: none;
        }

        .skin-editor-backdrop {
            display: none;
        }

        .skin-editor-dialog {
            position: fixed;
            right: 24px;
            top: 48px;
            width: 680px;
            max-width: calc(100vw - 32px);
            height: 84vh;
            min-height: 380px;
            max-height: calc(100vh - 56px);
            background: var(--bg-stage);
            border: none;
            border-radius: 10px;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.78);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            z-index: 2001;
            pointer-events: auto;
            resize: both;
            min-width: min(460px, calc(100vw - 32px));
            animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            transition: opacity 0.15s ease;
        }

        .skin-editor-modal.is-closing .skin-editor-dialog {
            animation: modalScaleDown 0.16s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
            pointer-events: none !important;
        }

        .skin-editor-dialog.is-dragging {
            user-select: none;
            opacity: 0.88;
            box-shadow: 0 20px 56px rgba(0, 0, 0, 0.8);
            transition: none;
        }

        .skin-editor-dialog.is-collapsed {
            height: auto !important;
            min-height: 0 !important;
            resize: none !important;
            border: none !important;
        }

        .skin-editor-dialog.is-collapsed .skin-editor-tabs {
            display: none !important;
        }

        /* 弹窗头部 (可按住拖拽) */
        .skin-editor-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 16px;
            border-bottom: 1px solid var(--border-subtle);
            background: var(--bg-dialog);
            flex-shrink: 0;
            cursor: grab;
            user-select: none;
        }

        .skin-editor-header:active,
        .skin-editor-dialog.is-dragging .skin-editor-header {
            cursor: grabbing;
        }

        .skin-editor-title-area {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .header-drag-handle {
            font-size: 0.95rem;
            color: rgba(255, 255, 255, 0.35);
            cursor: grab;
            line-height: 1;
            transition: color 0.15s ease;
        }

        .skin-editor-header:hover .header-drag-handle {
            color: rgba(255, 255, 255, 0.7);
        }

        .skin-editor-title-area .header-icon {
            font-size: 1.15rem;
            line-height: 1;
            display: flex;
            align-items: center;
            color: var(--primary);
        }

        .skin-editor-title-area h2 {
            margin: 0;
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-main);
            letter-spacing: 0.2px;
        }

        .skin-editor-header-actions {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        /* 标签页导航 */
        .skin-editor-tabs {
            display: flex;
            gap: 4px;
            padding: 0 16px;
            background: var(--bg-stage);
            border-bottom: 1px solid var(--border-subtle);
            flex-shrink: 0;
            overflow-x: auto;
        }

        .tab-btn {
            padding: 8px 14px;
            background: transparent;
            border: none;
            border-radius: 6px 6px 0 0;
            color: var(--text-muted);
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
            white-space: nowrap;
        }

        .tab-btn:hover {
            color: var(--btn-hover-text);
            background: var(--btn-hover-bg);
        }

        .tab-btn:active {
            transform: scale(0.96);
            background: var(--btn-active-bg);
        }

        .tab-btn:focus,
        .tab-btn:focus-visible {
            outline: none;
        }

        .tab-btn.active {
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.06);
            border-bottom: 2px solid var(--primary);
        }

        .tab-btn.active:hover {
            color: var(--btn-hover-text);
            background: var(--btn-hover-bg);
        }


        /* ===== 简单贴图编辑器外壳与子弹窗 ===== */
        .texture-image-modal {
            position: fixed;
            inset: 0;
            z-index: 2400;
            display: none;
            pointer-events: none;
        }

        .texture-image-modal.active,
        .texture-image-modal.is-closing {
            display: block;
        }

        .texture-image-modal.is-closing {
            pointer-events: none;
        }

        .texture-image-backdrop {
            display: none;
        }

        .texture-image-dialog {
            position: fixed;
            right: 24px;
            top: 48px;
            z-index: 2401;
            width: min(1040px, calc(100vw - 32px));
            max-width: calc(100vw - 32px);
            height: 84vh;
            min-width: min(460px, calc(100vw - 32px));
            min-height: 380px;
            max-height: calc(100vh - 56px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--bg-stage);
            border: none;
            border-radius: 10px;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.78);
            pointer-events: auto;
            resize: both;
            animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            transition: opacity 0.15s ease;
        }

        .texture-image-modal.is-closing .texture-image-dialog {
            animation: modalScaleDown 0.16s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
            pointer-events: none !important;
        }

        .texture-image-dialog.is-dragging {
            user-select: none;
            opacity: 0.88;
            box-shadow: 0 20px 56px rgba(0, 0, 0, 0.8);
            transition: none;
        }

        .texture-image-dialog.is-collapsed {
            height: auto !important;
            min-height: 0 !important;
            resize: none !important;
            border: none !important;
        }

        .texture-image-dialog.is-collapsed .texture-image-tabs,
        .texture-image-dialog.is-collapsed .texture-image-body,
        .texture-image-dialog.is-collapsed .texture-image-footer {
            display: none !important;
        }

        .texture-image-scope-modal {
            z-index: 2500;
            pointer-events: auto;
        }

        .texture-image-scope-backdrop {
            background: rgba(0, 0, 0, 0.58);
            backdrop-filter: blur(2px);
        }

        .texture-image-scope-dialog {
            position: relative;
            width: min(430px, calc(100vw - 40px));
            padding: 22px;
            border-radius: 10px;
            color: var(--text-main);
            background: var(--bg-dialog);
            border: none;
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.72);
            box-sizing: border-box;
        }

        .texture-image-scope-icon {
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
            border-radius: 8px;
            color: #ff8cba;
            background: rgba(255, 102, 170, 0.12);
        }

        .texture-image-scope-dialog h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 600;
        }

        .texture-image-scope-dialog p {
            margin: 8px 0 0;
            color: var(--text-muted);
            font-size: 0.76rem;
            line-height: 1.55;
        }

        .texture-image-scope-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 20px;
            flex-wrap: wrap;
        }

        .texture-image-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 14px 18px;
            border-bottom: 1px solid var(--border-subtle);
            background: var(--bg-dialog);
            flex-shrink: 0;
            cursor: grab;
            user-select: none;
        }

        .texture-image-header:active,
        .texture-image-dialog.is-dragging .texture-image-header {
            cursor: grabbing;
        }

        .texture-image-header-actions {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }

        .texture-image-header .header-drag-handle {
            flex-shrink: 0;
            color: rgba(255, 255, 255, 0.35);
            cursor: grab;
            transition: color 0.15s ease;
        }

        .texture-image-header:hover .header-drag-handle {
            color: rgba(255, 255, 255, 0.7);
        }

        .texture-image-title-group {
            display: flex;
            align-items: center;
            gap: 11px;
            min-width: 0;
        }

        .texture-image-title-icon {
            width: 34px;
            height: 34px;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            color: #ff8cba;
            background: rgba(255, 255, 255, 0.07);
        }

        .texture-image-title-group h3 {
            margin: 0;
            color: var(--text-main);
            font-size: 1rem;
            font-weight: 600;
            line-height: 1.2;
        }

        .texture-image-tabs {
            min-height: 45px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 18px;
            border-bottom: 1px solid var(--border-subtle);
            background: rgba(255, 255, 255, 0.015);
            box-sizing: border-box;
        }

        .texture-image-tab-list {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 4px;
            flex: 1 1 auto;
            overflow-x: auto;
            scrollbar-width: none;
        }

        .texture-image-tab-list::-webkit-scrollbar {
            display: none;
        }

        .texture-image-tab {
            min-width: 108px;
            max-width: 220px;
            height: 32px;
            display: inline-flex;
            align-items: center;
            gap: 7px;
            flex: 0 1 auto;
            padding: 0 9px 0 12px;
            color: var(--text-muted);
            background: rgba(255, 255, 255, 0.05);
            border: none;
            border-radius: 7px 7px 0 0;
            box-sizing: border-box;
            cursor: pointer;
            user-select: none;
            transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
        }

        .texture-image-tab:hover {
            color: var(--btn-hover-text);
            background: var(--btn-hover-bg);
        }

        .texture-image-tab:active {
            transform: scale(0.96);
            background: var(--btn-active-bg);
        }

        .texture-image-tab.is-active {
            color: var(--text-main);
            background: var(--bg-dark-secondary);
            box-shadow: inset 0 2px 0 rgba(255, 102, 170, 0.72);
        }

        .texture-image-tab.is-active:hover {
            color: var(--btn-hover-text);
            background: var(--btn-hover-bg);
        }

        .texture-image-tab:hover .texture-image-tab-close {
            color: var(--btn-hover-text);
        }

        .texture-image-tab-label {
            min-width: 0;
            flex: 1 1 auto;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 0.72rem;
            font-weight: 600;
        }

        .texture-image-tab-dirty {
            width: 6px;
            height: 6px;
            flex: 0 0 auto;
            border-radius: 50%;
            background: var(--primary);
        }

        .texture-image-tab-close {
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto;
            padding: 0;
            color: var(--text-muted);
            background: transparent;
            border: none;
            border-radius: 4px;
            font: inherit;
            font-size: 0.72rem;
            line-height: 1;
            cursor: pointer;
            transition: color 0.15s ease, background 0.15s ease;
        }

        .texture-image-tab-close:hover {
            color: var(--btn-hover-text);
            background: rgba(17, 17, 24, 0.12);
        }

        .texture-image-body {
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }


        /* ===== 贴图编辑工作区与预览 ===== */
        .texture-image-editor-view {
            height: 100%;
            min-height: 0;
            display: flex;
            gap: 16px;
            padding: 16px 18px;
            box-sizing: border-box;
        }

        .texture-image-preview-panel {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 9px;
        }

        .texture-image-preview-wrap {
            flex: 1;
            min-height: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: none;
            border-radius: 8px;
            background: #000000;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        }

        .texture-image-preview-wrap canvas {
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            flex-shrink: 0;
            touch-action: none;
            cursor: default;
        }

        .texture-image-preview-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
            color: var(--text-muted);
            font-size: 0.72rem;
            font-family: var(--font-clean);
            font-variant-numeric: tabular-nums;
        }

        .texture-image-preview-sizes {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
        }

        .texture-image-preview-zoom {
            display: flex;
            align-items: center;
            gap: 5px;
            margin-left: auto;
            padding: 3px 6px;
            border-radius: 7px;
            background: rgba(255, 255, 255, 0.055);
            border: none;
        }

        .texture-image-preview-zoom .texture-image-zoom-btn {
            width: 22px;
            height: 22px;
            min-width: 22px;
            min-height: 22px;
            padding: 0;
            color: var(--text-secondary);
            background: transparent;
            border: none;
        }

        .texture-image-preview-zoom input[type="range"] {
            width: 82px;
        }

        .texture-image-preview-zoom-value {
            width: 38px;
            color: var(--text-muted);
            font-size: 0.66rem;
            text-align: right;
        }

        .texture-image-controls {
            width: 355px;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            gap: 12px;
            overflow-y: auto;
        }

        .texture-image-control-section {
            padding: 12px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.035);
            border: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
        }

        .texture-image-control-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 11px;
        }

        .texture-image-control-title {
            color: var(--text-main);
            font-size: 0.82rem;
            font-weight: 600;
        }

        .texture-image-small-btn {
            flex-shrink: 0;
            padding: 5px 9px !important;
            font-size: 0.7rem !important;
        }

        .texture-image-number-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
        }

        .texture-image-number-grid label {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 4px;
            color: var(--text-muted);
            font-size: 0.69rem;
        }

        .texture-image-number-grid input,
        .texture-image-number-grid select {
            width: 100%;
            height: 30px;
            padding: 0 8px;
            color: var(--text-main);
            background: rgba(0, 0, 0, 0.34);
            border: 1px solid var(--border-medium);
            border-radius: 6px;
            outline: none;
            box-sizing: border-box;
            font-family: var(--font-clean);
            font-size: 0.76rem;
            font-variant-numeric: tabular-nums;
        }

        .texture-image-number-grid input:focus,
        .texture-image-number-grid select:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(255, 102, 170, 0.08);
        }

        .texture-image-number-grid select option {
            background: var(--bg-dark);
            color: var(--text-main);
        }

        .texture-image-number-grid input:disabled,
        .texture-image-number-grid select:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .texture-image-rgb-grid {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .texture-image-rgb-row {
            display: grid;
            grid-template-columns: 18px minmax(0, 1fr) 64px;
            align-items: center;
            gap: 8px;
        }

        .texture-image-rgb-channel {
            font-size: 0.72rem;
            font-weight: 700;
            text-align: center;
        }

        .texture-image-rgb-channel.is-r {
            color: #ff7380;
        }

        .texture-image-rgb-channel.is-g {
            color: #6fd58c;
        }

        .texture-image-rgb-channel.is-b {
            color: #72a7ff;
        }

        .texture-image-rgb-row input[type="range"] {
            width: 100%;
        }

        .texture-image-rgb-row input[type="range"]:focus {
            outline: none;
        }

        .texture-image-rgb-row input[type="number"] {
            width: 100%;
            height: 28px;
            padding: 0 7px;
            color: var(--text-main);
            background: rgba(0, 0, 0, 0.34);
            border: 1px solid var(--border-medium);
            border-radius: 6px;
            outline: none;
            box-sizing: border-box;
            font-family: var(--font-clean);
            font-size: 0.74rem;
            font-variant-numeric: tabular-nums;
        }

        .texture-image-rgb-row input[type="number"]:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(255, 102, 170, 0.08);
        }

        .texture-image-rgb-row input:disabled {
            opacity: 0.38;
            cursor: not-allowed;
        }

        /* 底部操作栏与分段保存菜单 */
        .texture-image-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 18px;
            border-top: 1px solid var(--border-subtle);
            background: rgba(255, 255, 255, 0.02);
        }

        .texture-image-footer-right {
            display: flex;
            align-items: center;
            gap: 9px;
            margin-left: auto;
        }

        .texture-image-save-actions {
            position: relative;
            display: inline-flex;
            align-items: stretch;
        }

        .texture-image-save-actions .texture-image-save-btn {
            border-radius: 6px;
        }

        @media (max-width: 820px) {
            .texture-image-dialog {
                height: 90vh;
                min-height: 560px;
            }

            .texture-image-footer {
                flex-wrap: wrap;
            }

            .texture-image-footer-right {
                width: 100%;
                flex-wrap: wrap;
                justify-content: flex-end;
            }

            .texture-image-editor-view {
                flex-direction: column;
                overflow-y: auto;
            }

            .texture-image-preview-panel {
                min-height: 240px;
                flex: 0 0 240px;
            }

            .texture-image-controls {
                width: 100%;
                overflow: visible;
            }
        }

