/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    overflow: hidden;
    background: #393939;
}

@font-face {
    font-family: 'HitbotHomeIcons';
    src: url('home-iconfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* 主容器 - 外层白色边框 */
.main-container {
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    padding: 2px;
    display: flex;
    flex-direction: column;
}

/* 顶部菜单栏 */
.top-menu-bar {
    height: 50px;
    background: #f7f7f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 0 0;
    box-shadow: none;
    border-bottom: none;
    color: #2b2b2f;
    position: relative;
    z-index: 1000;
    isolation: isolate;
    overflow: visible;
}

.menu-left {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
    padding-left: 0;
}

.hitbot-icon {
    font-family: 'HitbotHomeIcons', sans-serif;
    font-style: normal;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.project-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
    z-index: 1001;
}

.project-dropdown:hover,
.project-dropdown.open {
    background: rgba(0, 0, 0, 0.04);
}

.project-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0;
    background: transparent;
    border: none;
    height: 40px;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #2b2b2f;
    border-radius: 0;
}

.project-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 5px;
    margin-top: 5px;
    background: #ffffff;
    border: 1px solid rgba(18, 18, 20, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
    min-width: 350px;
    z-index: 1002;
    display: none;
    padding: 12px 0 10px;
    color: #2b2b2f;
}

.project-dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    top: -5px;
    width: 100%;
    height: 5px;
}

.project-dropdown-menu.open {
    display: block;
}

.project-icon {
    width: 16px;
    height: 24px;
    margin: 0 12px;
    font-size: 16px;
    line-height: 24px;
    color: rgba(31, 31, 35, 0.6);
}

.project-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.project-name {
    font-size: 16px;
    font-weight: 400;
    color: #1f1f23;
    line-height: 24px;
    white-space: nowrap;
}

.project-team {
    font-size: 12px;
    color: rgba(31, 31, 35, 0.5);
    line-height: 16px;
    white-space: nowrap;
}

.project-chevron {
    width: 12px;
    height: 16px;
    margin-left: 8px;
    font-size: 12px;
    line-height: 16px;
    color: rgba(31, 31, 35, 0.62);
}

.project-dropdown-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    margin-bottom: 10px;
}

.project-dropdown-toolbar-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #232328;
}

.project-dropdown-toolbar-icon {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 16px;
}

.project-dropdown-toolbar-text {
    line-height: 16px;
}

.project-team-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 24px;
    padding: 0 11px;
    border-radius: 4px;
    background: #f1f2f4;
    font-size: 14px;
    color: #232328;
}

.project-team-chip-arrow {
    font-size: 10px;
    color: rgba(35, 35, 40, 0.62);
}

.project-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    margin-bottom: 8px;
}

.project-dropdown-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #232328;
}

.project-dropdown-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.project-dropdown-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: rgba(35, 35, 40, 0.56);
}

.project-dropdown-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 65px;
    padding: 10px 12px;
    cursor: pointer;
}

.project-dropdown-item::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 1px;
    background: rgba(24, 24, 28, 0.08);
}

.project-dropdown-item:last-child::after {
    display: none;
}

.project-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.project-dropdown-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.project-dropdown-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1;
}

.project-dropdown-item-title {
    display: flex;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-dropdown-item-name {
    font-size: 14px;
    line-height: 24px;
    color: #232328;
}

.project-dropdown-item-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 4px;
    margin-right: 4px;
    border: 1px solid #dc2626;
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    color: #dc2626;
    flex: 0 0 auto;
}

.project-dropdown-item-time {
    font-size: 12px;
    line-height: 16px;
    margin-top: 4px;
    color: rgba(35, 35, 40, 0.48);
}

.project-dropdown-item-more {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'HitbotHomeIcons', sans-serif;
    font-size: 14px;
    line-height: 32px;
    color: rgba(35, 35, 40, 0.56);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    overflow: hidden;
    flex: 0 0 auto;
}

.project-dropdown-item-more:hover,
.project-dropdown-item-more[aria-expanded="true"] {
    background: transparent;
    color: rgba(35, 35, 40, 0.82);
    opacity: 1;
}

.project-item-menu {
    position: fixed;
    min-width: 96px;
    padding: 4px 0;
    background: #ffffff;
    border: 1px solid rgba(18, 18, 20, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    z-index: 1003;
    display: none;
}

.project-item-menu.open {
    display: block;
}

.project-item-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0 12px;
    height: 32px;
    font-size: 13px;
    line-height: 32px;
    color: #2f3137;
    cursor: pointer;
}

.project-item-menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    color: #232328;
    padding: 0 12px;
}

.platform-badge-icon {
    font-size: 11px;
    color: rgba(35, 35, 40, 0.56);
}

.platform-badge-label {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
}

/* 右侧区域 */
.menu-right {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
    padding-right: 0;
    overflow: visible;
}

.menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #2c2c31;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after,
[data-tooltip]::before {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(28, 30, 36, 0.92);
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    z-index: 80;
}

[data-tooltip]::before {
    content: "";
    position: absolute;
    left: calc(50% - 4px);
    top: calc(100% + 6px);
    width: 8px;
    height: 8px;
    background: rgba(28, 30, 36, 0.92);
    transform: rotate(45deg) translateY(4px);
    z-index: 79;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before,
[data-tooltip][data-tooltip-visible="true"]::after,
[data-tooltip][data-tooltip-visible="true"]::before {
    opacity: 1;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after,
[data-tooltip][data-tooltip-visible="true"]::after {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before,
[data-tooltip][data-tooltip-visible="true"]::before {
    transform: rotate(45deg) translateY(0);
}

.menu-btn:hover,
.current-user-btn:hover,
.download-menu-btn:hover,
.current-user-inline:hover .current-user-btn,
.current-user-inline:hover {
    background: rgba(0, 0, 0, 0.04);
}

.top-icon-btn {
    width: 44px;
    height: 50px;
    padding: 0;
}

.top-icon-btn.subdued {
    color: rgba(44, 44, 49, 0.7);
}

.top-icon-btn .hitbot-icon {
    width: 20px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
}

.top-icon-btn.subdued .hitbot-icon {
    width: 20px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
}

.top-menu-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.download-menu-btn {
    width: 46px;
    height: 50px;
    padding: 0;
}

.download-menu-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(44, 44, 49, 0.74);
}

.download-menu-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: currentColor;
}

.current-user-inline {
    display: flex;
    align-items: center;
    height: 100%;
}

.current-user-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #2c2c31;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.current-user-btn {
    height: 49px;
    padding: 12px;
    display: inline-flex;
    align-items: center;
}

.current-user-avatar {
    width: 25px;
    height: 25px;
    border-radius: 999px;
    overflow: hidden;
    background: #7e7e7e;
    flex: 0 0 auto;
}

.current-user-avatar img {
    width: 100%;
    height: 100%;
    display: block;
}

.current-user-name {
    padding-left: 8px;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 14px;
    font-weight: 500;
    color: #2c2c31;
}

.top-menu-dropdown.open .current-user-btn,
.top-menu-dropdown.open .download-menu-btn {
    background: rgba(0, 0, 0, 0.05);
}

.top-dropdown-menu {
    position: absolute;
    top: calc(100% - 2px);
    right: 0;
    min-width: 88px;
    padding: 4px 0;
    background: #ffffff;
    border: 1px solid rgba(24, 24, 29, 0.08);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 18, 22, 0.12);
    display: none;
    z-index: 20;
}

.top-menu-dropdown.open .top-dropdown-menu {
    display: block;
}

.top-dropdown-menu-compact {
    min-width: 198px;
}

.top-dropdown-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0 16px;
    height: 32px;
    font-size: 13px;
    line-height: 32px;
    color: #2f3137;
    cursor: pointer;
}

.top-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.top-menu-divider {
    width: 1px;
    height: 16px;
    margin: 0 8px;
    background: rgba(44, 44, 49, 0.22);
    display: inline-block;
}

.top-menu-tooltip-layer {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(28, 30, 36, 0.92);
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.top-menu-tooltip-layer.visible {
    opacity: 1;
    transform: translateY(0);
}

.top-menu-tooltip-layer::before {
    content: "";
    position: absolute;
    top: -4px;
    left: calc(50% - 4px);
    width: 8px;
    height: 8px;
    background: rgba(28, 30, 36, 0.92);
    transform: rotate(45deg);
}

/* 工作空间 */
.workspace {
    flex: 1;
    background: #e5e5e5;
    background-image: radial-gradient(circle, #d0d0d0 1px, transparent 1px);
    background-size: 12px 12px;
    background-position: 0 0;
    padding: 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
}

/* 布局选择器 */
.layout-selector {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    background: rgba(216, 216, 216, 0.65);
    border-radius: 12px;
    padding: 32px;
}

.layout-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
}

.layout-options {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: center;
    width: auto;
}

.layout-break {
    flex-basis: 100%;
    height: 0;
}

.layout-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.layout-option:hover {
    transform: translateY(-2px);
}

.layout-preview {
    width: 100px;
    height: 80px;
    background: rgba(240, 240, 240, 0.7);
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s ease;
    opacity: 0.9;
}

.layout-option:hover .layout-preview {
    background: rgba(232, 232, 232, 0.8);
    opacity: 1;
}

.preview-grid {
    width: 100%;
    height: 100%;
    display: grid;
    gap: 2px;
    opacity: 0.8;
}

/* 布局一：上一行一宽，下一行两格 */
.layout1 .preview-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.layout1 .preview-cell:first-child {
    grid-column: 1 / 3;
}

.preview-cell {
    background: rgba(119, 119, 119, 0.7);
    border-radius: 2px;
}

/* 布局二：宽+2个小格 */
.layout2 .preview-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.layout2 .preview-cell.wide {
    grid-row: 1 / 3;
}

/* 布局三：三列并排 */
.layout3 .preview-grid {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
}

/* 双窗口布局预览样式 */
.dual-grid {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
}

.dual-grid-vertical {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr;
}

/* 左右 7:3 */
.dual-lr-73 .dual-grid {
    grid-template-columns: 7fr 3fr;
    grid-template-rows: 1fr;
}

/* 左右 5:5 */
.dual-lr-55 .dual-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

/* 上下 5:5 */
.dual-tb-55 .dual-grid-vertical {
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr;
}

/* 布局标签样式 */
.layout-label {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* 实际布局容器 */
.layout-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 2px;
    display: grid;
    gap: 2px;
}

/* 布局单元格 */
.layout-cell {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    position: relative;
    padding: 8px;
    gap: 8px;
    overflow: hidden;
}

.layout-cell:hover {
    background: rgba(0, 0, 0, 0.15);
}

.layout-cell.selected {
    background: rgba(0, 0, 0, 0.2);
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    gap: 0;
}

/* 窗口选项项 - 基于状态栏窗口管理按钮样式 */
.window-option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #e8e8e8;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
    position: relative;
    justify-content: center;
}

.window-option-item:hover {
    background-color: #ddd;
    border-color: #bbb;
}

.window-option-item i {
    font-size: 16px;
    opacity: 0.8;
}

.window-option-item span {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}



/* 选中状态的特殊样式 */
.layout-cell.selected .window-option-item {
    background-color: #404040;
    border-color: #555;
    color: #e0e0e0;
    padding: 16px;
}

.layout-cell.selected .window-option-item i {
    font-size: 24px;
    opacity: 1;
    color: #e0e0e0;
}

.layout-cell.selected .window-option-item span {
    font-size: 12px;
    color: #e0e0e0;
}



/* 布局一：上下分层 */
.layout-container.layout1 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.layout-container.layout1 .layout-cell:first-child {
    grid-column: 1 / 3;
    grid-row: 1;
}

.layout-container.layout1 .layout-cell:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.layout-container.layout1 .layout-cell:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

/* 布局二：左右分栏 */
.layout-container.layout2 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.layout-container.layout2 .layout-cell:first-child {
    grid-column: 1;
    grid-row: 1 / 3;
}

.layout-container.layout2 .layout-cell:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.layout-container.layout2 .layout-cell:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

/* 布局三：三列并排 */
.layout-container.layout3 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
}

/* 双窗口布局容器样式 */
/* 左右 7:3 */
.layout-container.dual-lr-73 {
    grid-template-columns: 7fr 3fr;
    grid-template-rows: 1fr;
}

/* 左右 5:5 */
.layout-container.dual-lr-55 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

/* 上下 5:5 */
.layout-container.dual-tb-55 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
}



/* 状态栏 */
.status-bar {
    height: 24px;
    background: #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    font-size: 11px;
    color: #333;
}

.status-left {
    display: flex;
    gap: 8px;
    flex: 1;
}

.status-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

.status-right {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

/* 窗口管理器样式 */
.window-manager {
    display: flex;
    gap: 4px;
    align-items: center;
}

.window-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #e8e8e8;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    padding: 2px 6px;
    font-size: 10px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 70px;
    position: relative;
}

.window-item:hover {
    background-color: #ddd;
    border-color: #bbb;
}

.window-item.active {
    background-color: #404040;
    border-color: #555;
    color: #e0e0e0;
}

.window-item i {
    font-size: 11px;
    opacity: 0.8;
}

.window-item.active i {
    opacity: 1;
    color: #e0e0e0;
}



.status-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.status-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

.status-btn i {
    font-size: 12px;
}

.status-btn.error-log {
    position: relative;
}

.status-btn.error-log:hover {
    background-color: #ffe6e6;
    color: #d73527;
}

.error-count {
    background: #BD1C22;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    font-weight: bold;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2b2b2b;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* ========================================
   3D 视口模型样本（用于绑定测试）
   ======================================== */
.webgl-scene-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: block;
    cursor: grab;
    touch-action: none;
}

.webgl-scene-canvas:active {
    cursor: grabbing;
}

.scene-objects {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: center;
    width: 400px;
    max-width: 80%;
    perspective: 800px;
    pointer-events: auto;
    z-index: 3;
}

.scene-object {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.scene-object:hover {
    transform: scale(1.08);
    filter: brightness(1.15);
}

.scene-object:hover .object-label {
    color: #BD1C22;
}

.object-label {
    color: #aaaaaa;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    transition: color 0.2s;
}

.viewport-3d.webgl-ready .scene-objects {
    left: 0;
    top: 0;
    transform: none;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    perspective: none;
    pointer-events: none;
}

.viewport-3d.webgl-ready .scene-object {
    position: absolute;
    width: 28px;
    height: 28px;
    gap: 0;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    opacity: 1;
    pointer-events: auto;
}

.viewport-3d.webgl-ready.binding-panel-open .scene-object,
.viewport-3d.webgl-ready.binding-pick-mode .scene-object {
    opacity: 1;
    pointer-events: auto;
}

.viewport-3d.webgl-ready .scene-object:nth-child(1) {
    left: 39%;
    top: 40%;
}

.viewport-3d.webgl-ready .scene-object:nth-child(2) {
    left: 49%;
    top: 45%;
}

.viewport-3d.webgl-ready .scene-object:nth-child(3) {
    left: 58%;
    top: 46%;
}

.viewport-3d.webgl-ready .scene-object:nth-child(4) {
    left: 53%;
    top: 56%;
}

.viewport-3d.webgl-ready .scene-object:nth-child(5) {
    left: 64%;
    top: 55%;
}

.viewport-3d.webgl-ready .scene-object:nth-child(6) {
    left: 45%;
    top: 33%;
}

.viewport-3d.webgl-ready .scene-object:nth-child(7) {
    left: 69%;
    top: 37%;
}

.viewport-3d.webgl-ready .scene-object::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(234, 236, 222, 0.82);
    box-shadow: 0 0 0 3px rgba(43, 43, 43, 0.72);
    opacity: 0;
}

.viewport-3d.webgl-ready .scene-object.is-selected::before {
    background: #BD1C22;
    box-shadow: 0 0 0 3px rgba(43, 43, 43, 0.82), 0 0 0 5px rgba(189, 28, 34, 0.32);
    opacity: 1;
}

.viewport-3d.webgl-ready .scene-object:hover {
    transform: translate(-50%, -50%) scale(1.25);
}

.viewport-3d.webgl-ready .object-3d {
    display: none;
}

.viewport-3d.webgl-ready .object-label {
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translateX(-50%);
    padding: 3px 6px;
    color: #deded8;
    background: rgba(35, 35, 35, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
}

.viewport-3d.webgl-ready .scene-object:hover .object-label,
.viewport-3d.webgl-ready .scene-object.is-selected .object-label,
.viewport-3d.webgl-ready.binding-panel-open .object-label,
.viewport-3d.webgl-ready.binding-pick-mode .object-label {
    opacity: 1;
}

.viewport-3d.webgl-ready .scene-object:hover::before,
.viewport-3d.webgl-ready .scene-object.is-selected::before,
.viewport-3d.webgl-ready.binding-panel-open .scene-object::before,
.viewport-3d.webgl-ready.binding-pick-mode .scene-object::before {
    opacity: 1;
}

.viewport-3d.webgl-unavailable .webgl-scene-canvas {
    display: none;
}

.gripper-context-menu {
    position: absolute;
    z-index: 20;
    width: 180px;
    padding: 4px;
    background: rgba(42, 42, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.gripper-context-menu-title {
    padding: 6px 10px 7px;
    color: #f1f1ed;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gripper-context-menu.hidden,
.gripper-range-panel.hidden {
    display: none;
}

.gripper-context-menu button {
    width: 100%;
    height: 30px;
    padding: 0 10px;
    color: #d8d8d2;
    background: transparent;
    border: 0;
    border-radius: 3px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gripper-context-menu button i {
    width: 14px;
    color: inherit;
    text-align: center;
}

.gripper-context-menu button:hover:not(:disabled) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.gripper-context-menu button:disabled {
    color: rgba(216, 216, 210, 0.36);
    cursor: not-allowed;
}

.gripper-context-menu-hint {
    padding: 6px 10px 7px;
    color: rgba(216, 216, 210, 0.52);
    font-size: 10px;
    line-height: 15px;
}

.gripper-context-menu-hint[hidden] {
    display: none;
}

.viewport-3d.scene-drop-active::after {
    content: "释放以添加到 3D 场景";
    position: absolute;
    inset: 12px;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(189, 28, 34, 0.76);
    border-radius: 6px;
    background: rgba(35, 35, 35, 0.72);
    color: #f4f1ed;
    font-size: 13px;
    pointer-events: none;
}

.gripper-range-panel {
    position: absolute;
    right: 18px;
    top: 58px;
    z-index: 19;
    width: 360px;
    min-height: 188px;
    background: rgba(43, 43, 43, 0.96);
    border-radius: 4px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.gripper-range-panel-header {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 0 12px;
    color: #d8d8d2;
    font-size: 12px;
}

.gripper-range-panel-header button {
    width: 24px;
    height: 24px;
    color: #bbbbbb;
    background: transparent;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    line-height: 20px;
}

.gripper-range-panel-header button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.gripper-range-panel-body {
    padding: 12px 14px 14px;
}

.gripper-range-table {
    display: grid;
    grid-template-columns: 60px repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 10px;
    align-items: center;
}

.gripper-range-unit-head {
    grid-column: 1 / -1;
    min-width: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.045);
    border-radius: 4px;
}

.gripper-range-unit-head span {
    min-width: 0;
    color: #d8d8d2;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.gripper-range-unit-head strong {
    flex: 0 0 auto;
    color: #dcefdc;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
}

.gripper-range-column-label {
    color: #8f8f89;
    font-size: 12px;
    line-height: 16px;
    text-align: left;
    white-space: nowrap;
}

.gripper-range-row-label {
    min-width: 0;
    color: #b9b9b3;
    font-size: 12px;
    line-height: 26px;
    white-space: nowrap;
}

.gripper-range-input-wrap {
    min-width: 0;
    height: 26px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px;
    align-items: center;
    background: #343434;
    border-radius: 3px;
}

.gripper-range-input-wrap input {
    width: 100%;
    min-width: 0;
    height: 24px;
    padding: 0 7px;
    color: #deded8;
    background: transparent;
    border: 0;
    font-size: 12px;
    outline: none;
}

.gripper-range-input-wrap:focus-within {
    background: rgba(191, 255, 197, 0.12);
}

.gripper-range-input-wrap.is-range-active {
    background: rgba(191, 255, 197, 0.14);
}

.gripper-range-input-wrap em {
    color: #8f8f89;
    font-style: normal;
    font-size: 12px;
    text-align: center;
}

.gripper-range-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gripper-range-overlay.hidden {
    display: none;
}

.gripper-range-line {
    stroke: rgba(191, 255, 197, 0.96);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.is-range-active .gripper-range-line {
    stroke: rgba(213, 255, 217, 1);
    stroke-width: 2.4;
}

.gripper-range-face {
    fill: rgba(191, 255, 197, 0.06);
    stroke: transparent;
    stroke-width: 0;
    vector-effect: non-scaling-stroke;
    cursor: col-resize;
    pointer-events: auto;
}

.gripper-range-face.is-range-active {
    fill: rgba(191, 255, 197, 0.24);
    stroke: rgba(191, 255, 197, 0.9);
    stroke-width: 1.4;
}

/* 3D 立方体 */
.object-3d.cube {
    width: 40px;
    height: 40px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-30deg);
}

.object-3d.cube .face {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid #555;
    box-sizing: border-box;
}

.object-3d.cube .front {
    background: rgba(100, 149, 237, 0.4);
    transform: translateZ(20px);
}

.object-3d.cube .back {
    background: rgba(100, 149, 237, 0.25);
    transform: translateZ(-20px) rotateY(180deg);
}

.object-3d.cube .left {
    background: rgba(100, 149, 237, 0.3);
    transform: rotateY(-90deg) translateZ(20px);
}

.object-3d.cube .right {
    background: rgba(100, 149, 237, 0.3);
    transform: rotateY(90deg) translateZ(20px);
}

.object-3d.cube .top {
    background: rgba(100, 149, 237, 0.5);
    transform: rotateX(90deg) translateZ(20px);
}

.object-3d.cube .bottom {
    background: rgba(100, 149, 237, 0.2);
    transform: rotateX(-90deg) translateZ(20px);
}

/* 3D 长方体 */
.object-3d.box {
    width: 50px;
    height: 30px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-30deg);
}

.object-3d.box .face {
    position: absolute;
    background: rgba(189, 28, 34, 0.4);
    border: 1px solid #666;
}

.object-3d.box .front,
.object-3d.box .back {
    width: 50px;
    height: 30px;
}

.object-3d.box .front {
    transform: translateZ(15px);
}

.object-3d.box .back {
    transform: translateZ(-15px) rotateY(180deg);
}

.object-3d.box .left,
.object-3d.box .right {
    width: 30px;
    height: 30px;
}

.object-3d.box .left {
    transform: rotateY(-90deg) translateZ(25px);
}

.object-3d.box .right {
    transform: rotateY(90deg) translateZ(25px);
}

.object-3d.box .top,
.object-3d.box .bottom {
    width: 50px;
    height: 30px;
}

.object-3d.box .top {
    transform: rotateX(90deg) translateZ(15px);
}

.object-3d.box .bottom {
    transform: rotateX(-90deg) translateZ(15px);
}

/* 3D 圆柱体 */
.object-3d.cylinder {
    width: 30px;
    height: 45px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-30deg);
}

.object-3d.cylinder .cylinder-side {
    position: absolute;
    width: 30px;
    height: 45px;
    background: rgba(50, 205, 50, 0.4);
    border: 1px solid #555;
    border-radius: 50%;
    transform: rotateX(90deg);
    top: 0;
}

.object-3d.cylinder .cylinder-top,
.object-3d.cylinder .cylinder-bottom {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(50, 205, 50, 0.5);
    border: 1px solid #555;
    box-sizing: border-box;
}

.object-3d.cylinder .cylinder-top {
    top: -7px;
    transform: rotateX(90deg) translateZ(7px);
}

.object-3d.cylinder .cylinder-bottom {
    bottom: -7px;
    transform: rotateX(90deg) translateZ(-7px);
}

/* 绑定模式下的提示 */
.viewport-3d.binding-pick-mode .scene-object:hover .object-label {
    color: #ff6b6b;
} 
