
html, body {
    height: 100%;
    background: #f2f2f2;
    touch-action: none;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.50;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    overflow: hidden;
}

#myViewer {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: stretch;
    z-index: 10000;
    /*overflow: hidden;*/
    position: absolute;
    left: 0;
    right: 0;
    --left: 0;
    --right: 0;
    transition: all 300ms ease-in-out;
    background: var(--bg);
}

#myToolbar {
    min-width: 400px;
    top: 0;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    z-index: 100000;
    pointer-events: all;
    position: fixed;
    left: 95px;
    transition: all 300ms ease-in-out;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    backdrop-filter: saturate(140%) blur(6px);
    box-shadow: var(--shadow);
}

#myCanvas {
    width: 100%;
    height: 100%;
    background: #f2f2f2;
    cursor: default;
    pointer-events: all;
    margin: 0;
    position: relative;
}

#myNavCubeCanvas {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 0;
    right: 0;
    z-index: 200000;
}

#myExplorer {
    position: fixed;
    height: 100%;
    color: #fff;
    background: var(--teal);
    overflow: auto;
    border-right: 2px solid var(--teal-border);
    padding: 0px;
    padding-bottom: 100px;
    padding-left: 15px;
    user-select: none;
    top: 0;
    left: -460px;
    z-index: 10;
    width: 460px;
    transition: all 300ms ease-in-out;
    backdrop-filter: saturate(140%) blur(6px);
    box-shadow: var(--shadow);
}

/* Explorer collapse button inside left panel */
.explorer-collapse-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 100001;
    pointer-events: all;
}

/* Fixed collapse button that stays visible even when explorer is hidden */
#explorer_collapse_fixed.explorer-collapse-fixed {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100001;
    pointer-events: all;
    transition: left 300ms ease-in-out;
}

/* When explorer is open, pin the button at the panel's outer edge */
#explorer_toggle:checked ~ #explorer_collapse_fixed.explorer-collapse-fixed {
    left: 460px;
}

#explorer_toggle {
    display: none;
}

.explorer_toggle_label {
    position: absolute;
    top: 10px;
    left: 20px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    flex: 1 1 auto;
    color: #009688;
    background-color: white;
    text-align: center;
    vertical-align: middle;
    border: 2px solid #009688;
    padding: .375rem .75rem;
    border-radius: .25rem;
    -webkit-appearance: button;
    overflow: visible;
    margin: 0 2px 0 0;
    box-sizing: border-box;
    align-items: flex-start;
    pointer-events: all;
    z-index: 100000;
    transition: all 300ms ease-in-out;
}

.explorer_toggle_label:hover {
    cursor: pointer;
}

#explorer_toggle:checked + .explorer_toggle_label {
    left: 480px;
    color: #fff;
    background-color: rgba(0, 150, 136, 0.85);
    border-color: #009688;
}

#explorer_toggle:checked ~ #myExplorer {
    left: 0;
}

#explorer_toggle:checked ~ #myViewer {
    left: 460px;
    --left: 460;
    width: calc(100% - (var(--left) + var(--right)));
}

#explorer_toggle:checked ~ #myToolbar {
    left: 555px;
}

#explorer_toggle:not(:checked) + .explorer_toggle_label {
    left: 20px;
    color: #fff;
    background-color: rgba(0, 150, 136, 0.85);
    border-color: #009688;
}

#explorer_toggle:not(:checked) ~ #myExplorer {
    left: -460px;
}

#explorer_toggle:not(:checked) ~ #myViewer {
    left: 0;
    --left: 0;
    width: calc(100% - var(--right));
}

#explorer_toggle:not(:checked) ~ #myToolbar {
    left: 95px;
}

#myInspector {
    position: absolute;
    height: 100%;
    color: #fff;
    background: var(--teal);
    overflow: auto;
    border-left: 2px solid var(--teal-border);
    padding: 0;
    top: 0;
    right: -360px;
    z-index: 40;
    width: 358px;
    transition: all 300ms ease-in-out;
    backdrop-filter: saturate(140%) blur(6px);
    box-shadow: var(--shadow);
}

#inspector_toggle {
    display: none;
}

.inspector_toggle_label {
    position: absolute;
    top: 10px;
    right: 20px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    flex: 1 1 auto;
    color: #009688;
    background-color: white;
    text-align: center;
    vertical-align: middle;
    border: 2px solid #009688;
    padding: .375rem .75rem; /* FIXME */
    border-radius: .25rem;
    -webkit-appearance: button;
    overflow: visible;
    margin: 0 2px 0 0; /* FIXME */
    box-sizing: border-box;
    align-items: flex-start;
    pointer-events: all;
    z-index: 100000;
    transition: all 300ms ease-in-out;
}

.inspector_toggle_label:hover {
    cursor: pointer;
}

#inspector_toggle:checked + .inspector_toggle_label {
    right: 380px;
    color: #fff;
    background-color: rgba(0, 150, 136, 0.85);
    border-color: #009688;
}

#inspector_toggle:checked ~ #myViewer {
    --right: 360;
    right:360px;
    width: calc(100% - (var(--left) + var(--right)));
}

#inspector_toggle:checked ~ #myInspector {
    right: 0;
    --right: 0;
}

#inspector_toggle:not(:checked) ~ #myInspector {
    right: -380px;
    --right: -380px;
}

/* 隐藏“物件属性查看”按钮（label） */
#inspector_toggle_label,
.inspector_toggle_label {
    display: none !important;
}

/* 固定属性面板收折按钮，靠右边缘显示并随面板状态调整 */
#inspector_collapse_fixed.inspector-collapse-fixed {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100001;
    pointer-events: all;
    transition: right 300ms ease-in-out;
}

/* 当属性面板展开时，按钮贴在面板外沿（左移面板宽度） */
#inspector_toggle:checked ~ #inspector_collapse_fixed.inspector-collapse-fixed {
    right: 360px;
}

/* 当属性面板收起时，按钮回到页面右上角 */
#inspector_toggle:not(:checked) ~ #inspector_collapse_fixed.inspector-collapse-fixed {
    right: 12px;
}

#inspector_toggle:not(:checked) ~ #myViewer {
    --right: 0;
    right: 0;
    width: calc(100% - var(--left));
}

/* --- Overrides: move toolbar and toggles to bottom center --- */
#myToolbar {
    bottom: 20px !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

#explorer_toggle:checked ~ #myToolbar,
#explorer_toggle:not(:checked) ~ #myToolbar {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.explorer_toggle_label {
    top: auto !important;
    bottom: 80px !important;
    left: calc(50% - 180px) !important;
    transform: translateX(-50%) !important;
}

#explorer_toggle:checked + .explorer_toggle_label,
#explorer_toggle:not(:checked) + .explorer_toggle_label {
    left: calc(50% - 180px) !important;
}

.inspector_toggle_label {
    top: auto !important;
    bottom: 80px !important;
    left: calc(50% + 180px) !important;
    transform: translateX(-50%) !important;
}

#inspector_toggle:checked + .inspector_toggle_label,
#inspector_toggle:not(:checked) + .inspector_toggle_label {
    left: calc(50% + 180px) !important;
}

/* Center buttons within toolbar */
.xeokit-toolbar {
    justify-content: center !important;
    gap: 6px 7px;
}

.xeokit-btn {
    pointer-events: all;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.xeokit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.xeokit-context-menu { padding-top: 6px; }
.xeokit-context-menu .xeokit-context-menu-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: 1px solid var(--teal-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--ink);
    padding: 0;
    line-height: 22px;
    cursor: pointer;
}
.xeokit-context-menu .xeokit-context-menu-close:hover {
    background: var(--teal);
    color: #ffffff;
}

/* Toolbar button size and layout normalization */
#myToolbar .xeokit-btn-group {
    gap: 4px;
    margin-right: 0 !important;
    margin-bottom: 3px;
}

#myToolbar .xeokit-btn {
    height: 31px;
    min-width: 31px;
    padding: 0 7px;
    border-radius: 7px;
    color: var(--ink);
    border-color: var(--teal-border) !important;
    background-color: #ffffff;
}

#myToolbar .xeokit-btn.fa,
#myToolbar .xeokit-btn.fas,
#myToolbar .xeokit-btn.fab {
    font-size: 14px;
    line-height: 31px;
}

#myToolbar .xeokit-btn.fa-2x {
    font-size: 14px;
}

#myToolbar .xeokit-btn.active {
    color: #ffffff;
    background-color: var(--teal);
    border-color: var(--teal-border) !important;
}

.bim4d-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 42%;
    z-index: 100000;
    display: grid;
    grid-template-columns: minmax(25px, 5%) 95%;
    grid-template-rows: 100%;
    gap: 12px;
    background: transparent;
    pointer-events: none;
}
.bim4d-panel.hidden { display: none; }
.bim4d-panel .b4-left,
.bim4d-panel .b4-right {
    display: grid;
    grid-template-rows: 100%;
    gap: 8px;
    overflow: auto;
}
.bim4d-panel .b4-left {
    grid-template-rows: 100%;
}
.bim4d-panel .b4-right {
    grid-template-rows: 100%;
    border-left: 2px solid #2b3649;
}
.bim4d-panel .b4-left > div,
.bim4d-panel .b4-right > div {
    background: rgba(13, 42, 79, 0.80);
    border: 1px solid #2b3649;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    backdrop-filter: saturate(140%) blur(4px);
    padding: 8px 10px;
    pointer-events: auto;
}

.bim4d-panel .b4-viewport-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.b4-title {
    color: #9fb3d2;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
}
.b4-tabs { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.b4-tab { color: #9fb3d2; font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; }
.b4-tab.active { color: #ffffff; background: #2c6fb7; border-color: #2b3649; }
.b4-tabs #b4-close { margin-left: auto; height: 28px; min-width: 8px; padding: 0; color: #e6eefc; background: rgba(13, 42, 79, 0.80); border-color: #2b3649; }
.b4-tabs #b4-close:hover { background: rgba(20,52,92,0.85); }
.b4-tabs #b4-link-model { width: 31px; height: 31px; min-width: 31px; padding: 0; border-radius: 7px; }
.b4-tabs #b4-batch-by-tag { width: 31px; height: 31px; min-width: 31px; padding: 0; border-radius: 7px; }
.b4-tabs #b4-sim-toggle,
.b4-tabs #b4-time-toggle { width: 31px; height: 31px; min-width: 31px; padding: 0; border-radius: 7px; }
.b4-sim-group { position: relative; }
.b4-sim-panel {
    position: absolute;
    top: 36px;
    right: 0;
    z-index: 1000004;
    background: rgba(28,36,50,0.96);
    border: 1px solid #2b3649;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 12px;
    min-width: 360px;
    display: none;
    max-height: 0;
    opacity: 0;
    transition: max-height 300ms ease, opacity 300ms ease;
}
.b4-sim-panel.expanded { display: block; max-height: 480px; opacity: 1; }
.b4-time-group { position: relative; }
.b4-time-panel {
    position: absolute;
    top: 36px;
    right: 0;
    z-index: 1000004;
    background: rgba(28,36,50,0.96);
    border: 1px solid #2b3649;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 12px;
    min-width: 300px;
    display: none;
    max-height: 0;
    opacity: 0;
    transition: max-height 300ms ease-in-out, opacity 300ms ease-in-out;
}
.b4-time-panel.expanded { display: block; max-height: 320px; opacity: 1; }
.b4-current-tip {
    position: fixed;
    z-index: 1000004;
    width: 300px;
    background: rgba(28,36,50,0.96);
    border: 1px solid #2b3649;
    border-radius: 8px;
    box-shadow: 0 2px 2px rgba(0,0,0,0.35);
    color: #e6eefc;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
}
.b4-current-tip.visible { opacity: 1; }
.b4-current-tip .cur-head {
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid #2b3649;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.b4-current-tip .cur-title { color: #e6eefc; }
.b4-current-tip .cur-timebox {
    padding: 3px 8px;
    border: 1px solid #ff4d4f;
    border-radius: 4px;
    background: rgba(255,77,79,0.10);
    color: #e6eefc;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
    direction: ltr;
    unicode-bidi: isolate;
}
.b4-current-tip .cur-time { font-weight: 600; letter-spacing: 0.3px; }
.b4-current-tip .cur-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.b4-current-tip .cur-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #1b2a42;
}
.b4-current-tip .cur-name {
    color: #e6eefc;
}
.b4-current-tip .cur-times {
    text-align: right;
    color: #9fb3d2;
    white-space: nowrap;
}
.b4-current-tip .cur-empty {
    padding: 10px;
    color: #9fb3d2;
}
.b4-history-group { display: inline-flex; gap: 6px; align-items: center; position: relative; }
.b4-history-dropdown {
    position: absolute;
    top: 32px;
    left: 0;
    z-index: 1000004;
    background: rgba(28,36,50,0.96);
    border: 1px solid #2b3649;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 6px 0;
    min-width: 160px;
}
.b4-history-dropdown .item {
    padding: 8px 12px;
    color: #e6eefc;
    cursor: pointer;
    white-space: nowrap;
}
.b4-history-dropdown .item:hover { background: rgba(18,38,68,0.85); }
.b4-tabs-filter {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.b4-tabs-filter input[type="date"] {
    height: 28px;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: #ffffff;
    color: #0d2a4f;
    padding: 0 6px;
}
.b4-content { position: relative; width: 100%; height: calc(100% - 32px); }
.b4-view-pane { position: absolute; inset: 0; transition: opacity 200ms ease; }
.b4-view-pane:not(.active) { opacity: 0; pointer-events: none; }
.b4-view-pane.active { opacity: 1; pointer-events: auto; }
.b4-gantt-filter {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 1000004;
}
.b4-gantt-filter input[type="date"] {
    height: 28px;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: #ffffff;
    color: #0d2a4f;
    padding: 0 6px;
}
.b4-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.25); z-index: 10; }
.b4-loading.hidden { display: none; }
.b4-loading::after { content: ""; width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.35); border-top-color: #2c6fb7; border-radius: 50%; animation: b4spin 0.8s linear infinite; }
@keyframes b4spin { to { transform: rotate(360deg); } }
.b4-wbs {
    overflow: auto;
    max-height: calc(100% - 28px);
}
.b4-tree .b4-tree-node {
    color: #e6eefc;
    padding: 6px 8px;
    background: rgba(20, 52, 92, 0.85);
    border-radius: 6px;
    margin-bottom: 6px;
}
.b4-tree .b4-tree-children .b4-tree-leaf {
    color: #d5e5ff;
    padding: 4px 8px;
    margin: 4px 0 0 8px;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: rgba(10, 28, 52, 0.85);
    cursor: pointer;
}
.b4-tree .b4-tree-children .b4-tree-leaf:hover {
    background: rgba(18, 38, 68, 0.85);
}
.bim4d-panel #b4-gantt {
    width: 100%;
    height: 100%;
    background: rgba(8, 20, 36, 0.9);
    border-radius: 6px;
}
.b4-view-pane #b4-table { width: 100%; border-collapse: collapse; }
.b4-table-scroller { position: absolute; inset: 40px 0 40px 0; overflow: auto; }
.b4-filter-bar {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto auto;
    gap: 8px;
    align-items: center;
    padding-bottom: 6px;
}
.b4-expand { display: flex; gap: 6px; align-items: center; color: #9fb3d2; }
.b4-expand select {
    height: 28px;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: rgba(18, 38, 68, 0.85);
    color: #e6eefc;
    padding: 0 6px;
}
.b4-filter-bar input[type="text"] {
    height: 28px;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: rgba(18, 38, 68, 0.85);
    color: #e6eefc;
    padding: 0 8px;
}
.b4-status { display: flex; gap: 8px; color: #9fb3d2; }
.b4-time { display: flex; gap: 6px; align-items: center; color: #9fb3d2; }
.b4-owner select,
.b4-filter-actions .b4-select {
    height: 28px;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: rgba(18, 38, 68, 0.85);
    color: #e6eefc;
    padding: 0 6px;
}
.b4-sep { color: #9fb3d2; }
.b4-table thead th {
    position: sticky;
    top: 0;
    background: rgba(8, 20, 36, 0.95);
    color: #9fb3d2;
    font-weight: 600;
    border-bottom: 1px solid #2b3649;
    padding: 6px 8px;
    cursor: pointer;
}
.b4-table tbody td {
    color: #e6eefc;
    border-bottom: 1px solid #1b2a42;
    padding: 6px 8px;
    vertical-align: middle;
}
.b4-status-timebox {
    float: right;
    margin-left: 8px;
    margin-inline-start: 8px;
    padding: 3px 8px;
    border: 1px solid #ff4d4f;
    border-radius: 4px;
    background: rgba(255,77,79,0.10);
    color: #e6eefc;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
    direction: ltr;
    unicode-bidi: isolate;
}
.b4-status-time {
    font-weight: 600;
    letter-spacing: 0.3px;
}
.b4-status-date {
    margin-left: 6px;
    color: #00b7ff;
    font-size: 12px;
    opacity: 0.9;
}
.b4-table tbody tr.b4-group td {
    background: rgba(20,52,92,0.85);
    color: #e6eefc;
    font-weight: 600;
    cursor: pointer;
}
.b4-table tbody tr.b4-row-edit td {
    background: rgba(0,183,255,0.12);
}
.b4-tag {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0, 183, 255, 0.18);
    border: 1px solid rgba(0, 183, 255, 0.35);
    color: #e6eefc;
    font-size: 12px;
}
.b4-menu {
    position: fixed;
    z-index: 1000003;
    background: rgba(28,36,50,0.96);
    border: 1px solid #2b3649;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    padding: 6px 0;
    min-width: 180px;
    display: none;
    pointer-events: all;
    backdrop-filter: saturate(140%) blur(4px);
}
.b4-menu-item {
    padding: 8px 12px;
    color: #e6eefc;
    cursor: pointer;
    white-space: nowrap;
}
.b4-menu-item:hover {
    background: rgba(18,38,68,0.85);
}
.b4-pager {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.b4-page-left, .b4-page-right { display: flex; gap: 8px; align-items: center; color: #9fb3d2; }
.b4-assoc-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000006;
    display: none;
    align-items: center;
    justify-content: center;
}
.b4-assoc-modal.hidden { display: none; }
.b4-assoc-dialog {
    width: 640px;
    max-width: calc(100% - 48px);
    background: rgba(13, 42, 79, 0.92);
    border: 1px solid #2b3649;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.b4-assoc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #e6eefc;
    border-bottom: 1px solid #2b3649;
}
.b4-assoc-body {
    padding: 12px;
    display: grid;
    gap: 10px;
}
.b4-assoc-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.b4-assoc-help { color: #9fb3d2; font-size: 12px; }
.b4-assoc-actions { display: flex; gap: 8px; justify-content: flex-end; }
.b4-assoc-preview {
    border-top: 1px solid #2b3649;
    padding-top: 8px;
}
.b4-assoc-preview img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    border: 1px solid #2b3649;
    border-radius: 6px;
    background: rgba(8, 20, 36, 0.9);
}

.b4-batch-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000007;
    display: none;
    align-items: center;
    justify-content: center;
}
.b4-batch-modal.hidden { display: none; }
.b4-batch-dialog {
    width: 760px;
    max-width: calc(100% - 48px);
    background: rgba(13, 42, 79, 0.92);
    border: 1px solid #2b3649;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.b4-batch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #e6eefc;
    border-bottom: 1px solid #2b3649;
}
.b4-batch-body {
    padding: 12px;
    display: grid;
    gap: 12px;
}
.b4-batch-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 8px;
    align-items: center;
    color: #9fb3d2;
}
.b4-batch-row input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    background: rgba(18,24,36,0.9);
    border: 1px solid #334056;
    color: #e6eefc;
    border-radius: 6px;
}
.b4-batch-count {
    color: #00b7ff;
    font-weight: 600;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0,183,255,0.35);
    background: rgba(0,183,255,0.12);
    white-space: nowrap;
}
.b4-batch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.b4-batch-item {
    display: grid;
    grid-template-columns: 18px 92px 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #2b3649;
    background: rgba(18, 38, 68, 0.65);
    color: #9fb3d2;
}
.b4-batch-item input[type="number"],
.b4-batch-item input[type="date"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    background: rgba(18,24,36,0.9);
    border: 1px solid #334056;
    color: #e6eefc;
    border-radius: 6px;
}
.b4-batch-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.b4-batch-text-row {
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #2b3649;
    background: rgba(18, 38, 68, 0.65);
    color: #9fb3d2;
}
.b4-batch-text-row textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    background: rgba(18,24,36,0.9);
    border: 1px solid #334056;
    color: #e6eefc;
    border-radius: 6px;
    resize: vertical;
}
.b4-batch-actions {
    padding: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #2b3649;
}
.b4-timeline {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 8px;
}
.b4-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
}
.b4-kpi {
    background: rgba(18, 38, 68, 0.85);
    border: 1px solid #2b3649;
    border-radius: 8px;
    padding: 8px;
}
.b4-kpi-label {
    color: #9fb3d2;
    font-size: 12px;
    margin-bottom: 4px;
}
.b4-kpi-value {
    color: #e6eefc;
    font-size: 18px;
    font-weight: 700;
}
.b4-alert {
    grid-column: 1 / -1;
    text-align: center;
    color: #fff;
    background: #2c6fb7;
    border-radius: 6px;
    padding: 6px 8px;
}
.b4-controls {
    display: grid;
    grid-template-columns: auto auto auto auto 1fr auto 1fr auto auto auto;
    gap: 6px;
    align-items: center;
}
.b4-btn:active {
    transform: translateY(0);
    filter: brightness(0.95);
}
.b4-stop {
    margin-left: 10px;
}
.b4-filter-indicator {
    grid-column: 1 / -1;
    margin-top: 6px;
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 183, 255, 0.15);
    border: 1px solid #2b3649;
    color: #00b7ff;
    font-weight: 600;
}
.b4-btn {
    color: #0d2a4f;
    background: #e6eefc;
    border: 1px solid #2b3649;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}
.b4-btn:hover {
    background: #d5e5ff;
}
.b4-btn.b4-primary { color: #fff; background: #2c6fb7; border-color: #2b3649; }
.b4-danger { background: #d9534f !important; color: #fff !important; border-color: #c9302c !important; }
.b4-inline {
    color: #9fb3d2;
    font-size: 12px;
}
.b4-views {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

#zybim-notes-manager {
    position: fixed;
    top: 80px;
    bottom: 20px;
    right: 12px;
    width: 358px; /* 与属性面板一致 */
    overflow: auto;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: saturate(140%) blur(6px);
    z-index: 1000005;
    pointer-events: all;
}
#zybim-notes-manager.hidden { display: none; }
#zybim-notes-manager .nm-header { display: flex; align-items: center; justify-content: space-between; color: var(--text); padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
#zybim-notes-manager .nm-actions { display: flex; gap: 8px; align-items: center; }
#zybim-notes-manager .nm-actions input { height: 28px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12); background: var(--surface-strong); color: var(--text); padding: 0 8px; }
#zybim-notes-manager .nm-list { padding: 6px 8px 12px 8px; }
#zybim-notes-manager .nm-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 6px; border-bottom: 1px dashed rgba(255,255,255,0.08); }
#zybim-notes-manager .nm-id { display: none; }
#zybim-notes-manager .nm-text { color: var(--text); font-size: 14px; font-weight: 600; opacity: 0.95; white-space: normal; word-break: break-word; }
#zybim-notes-manager .nm-ops { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); grid-auto-rows: auto; gap: 4px 6px; justify-content: end; align-content: start; }
#zybim-notes-manager .nm-ops .xeokit-btn { min-width: 44px; padding: 2px 6px; font-size: 11px; border-radius: 7px; line-height: 1.2; }
#zybim-notes-manager .nm-actions .xeokit-btn { white-space: nowrap; }

.help-overlay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 360px;
    color: var(--text);
    background: var(--surface-strong);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: saturate(140%) blur(6px);
    padding: 12px 14px;
    z-index: 100001;
}
.help-overlay h2 {
    margin: 0 0 8px;
    font-size: 16px;
}
.help-overlay ul { margin: 0; padding-left: 18px; }
.help-overlay li { margin: 6px 0; color: var(--text-weak); }
.help-overlay.hidden { display: none; }


@media (max-width: 1280px) {
    #explorer_toggle:checked ~ #myExplorer { width: 380px; }
    #explorer_toggle:checked ~ #myToolbar { left: calc(50% + 60px) !important; }
    #explorer_toggle:checked ~ #myViewer { --left: 380; left: 380px; }
}

@media (max-width: 992px) {
    #explorer_toggle:checked ~ #myExplorer { width: 300px; }
    #explorer_toggle:checked + .explorer_toggle_label { left: 320px; }
    #explorer_toggle:checked ~ #myViewer { --left: 300; left: 300px; }
    #inspector_toggle:checked ~ #myInspector { width: 300px; }
    #inspector_toggle:checked + .inspector_toggle_label { right: 320px; }
}

/* Hide the original explorer toggle label button */
.explorer_toggle_label {
    display: none !important;
}

/* Place inspector toggle inside toolbar row */
#myToolbar .inspector_toggle_label {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin: 0 2px !important;
}

/* Active state handled via .xeokit-btn.active */
#myToolbar .inspector_toggle_label.active {
    /* styling comes from .xeokit-btn.active */
}
:root {
    --bg: #0f141c;
    --surface: rgba(24, 32, 38, 0.6);
    --surface-strong: rgba(24, 32, 38, 0.8);
    --teal: rgba(0, 150, 136, 0.75);
    --teal-border: rgba(0, 150, 136, 0.9);
    --ink: rgba(15, 76, 58, 0.8);
    --text: #ffffff;
    --text-weak: #cfd8dc;
    --accent: #00b7ff;
    --radius: 10px;
    --shadow: 0 10px 24px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }

/* 备注标签面板 */
#zybim-note-panel {
    font-family: 'Roboto', sans-serif;
    backdrop-filter: saturate(140%) blur(4px);
}
#zybim-note-panel .note-header {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
#zybim-note-panel .note-footer .xeokit-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
}
#zybim-note-panel .note-footer .xeokit-btn:hover {
    background: var(--surface-strong);
}

@media (max-width: 768px) {
    #zybim-note-panel { left: 12px !important; right: 12px; max-width: none; width: calc(100% - 24px); }
}

/* 构件标签气泡 */
.zybim-object-tag {
    display: none;
    padding: 6px 10px 6px 14px;
    border-radius: 14px;
    color: #ffffff;
    font-size: 13px;
    line-height: 1;
    background: rgba(0, 183, 255, 0.24);
    border: 1px solid rgba(0, 183, 255, 0.45);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    backdrop-filter: saturate(140%) blur(4px);
}
.zybim-object-tag .tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2bb5ff;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 6px rgba(43,181,255,0.8);
}
.zybim-object-tag .tag-text {
    vertical-align: middle;
}
