﻿.office-engine-mount {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 420px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.10), transparent 28%),
        linear-gradient(180deg, rgba(249, 250, 251, 0.98), rgba(226, 232, 240, 1));
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.office-scene-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.office-scene-nameplate,
.office-scene-bubble {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    will-change: left, top, transform;
    font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
    font-weight: 700;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

.office-scene-nameplate {
    min-width: 44px;
    max-width: 96px;
    padding: 4px 8px;
    border-radius: 7px;
    border: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 55%, rgba(255, 255, 255, 0.28));
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    font-size: 12px;
    line-height: 1.15;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(148, 163, 184, 0.26);
}

.office-scene-nameplate[data-boss="true"] {
    min-width: 68px;
    max-width: 148px;
    padding: 6px 12px;
    font-size: 15px;
    background: rgba(255, 251, 235, 0.98);
    color: #78350f;
    border-color: rgba(250, 204, 21, 0.88);
    box-shadow: 0 12px 26px rgba(245, 158, 11, 0.18);
}

.office-scene-bubble {
    max-width: 220px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 42%, rgba(255, 255, 255, 0.22));
    background: rgba(255, 252, 244, 0.98);
    color: #111827;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
}

.office-scene-bubble[data-boss="true"] {
    max-width: 250px;
    font-size: 15px;
}

.office-scene-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -7px;
    width: 12px;
    height: 12px;
    background: rgba(255, 252, 244, 0.98);
    border-right: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 42%, rgba(255, 255, 255, 0.22));
    border-bottom: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 42%, rgba(255, 255, 255, 0.22));
    transform: translateX(-50%) rotate(45deg);
}

.office-scene-activate-wrap {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 3;
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
}

.office-scene-activate-btn {
    pointer-events: auto;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.3);
}

.office-scene-activate-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, 0.42);
    background: rgba(255, 251, 235, 0.96);
}

.office-scene-activate-btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.office-engine-mount canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    transform: translateZ(0);
    opacity: 0;
    transition: opacity 180ms ease;
}

#office-stage-canvas {
    height: auto;
    min-height: 520px;
    aspect-ratio: 16 / 9;
}

.stage-card[data-view-mode="simple"] .office-engine-mount {
    min-height: 420px;
    border-radius: 18px;
}

.stage-card[data-view-mode="simple"] #office-stage-canvas {
    height: auto;
    min-height: 420px;
    aspect-ratio: 16 / 9;
}

#team-hub-scene {
    min-height: 360px;
    height: 360px;
}

#control-office-scene {
    min-height: 520px;
    height: 520px;
}

#stage-page-canvas {
    min-height: min(86vh, 860px);
    height: calc(100vh - 102px);
}

.stage-page-body {
    margin: 0;
    background:
        radial-gradient(circle at left top, rgba(56, 189, 248, 0.1), transparent 26%),
        linear-gradient(180deg, #040914, #07111d 38%, #081220 100%);
    color: #e2e8f0;
    font-family: var(--font-sans, "Microsoft YaHei UI", sans-serif);
}

.stage-page-shell {
    min-height: 100vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stage-page-topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    background: rgba(8, 16, 31, 0.88);
}

.stage-page-brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stage-page-brand strong {
    font-family: var(--font-display);
    font-size: 20px;
}

.stage-page-brand span,
.stage-page-status {
    color: var(--text-soft);
    font-size: 13px;
}

.stage-page-status {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(3, 7, 18, 0.72);
}

.timeline-item.kind-report {
    border-color: rgba(56, 189, 248, 0.28);
}

.timeline-item.kind-failover {
    border-color: rgba(250, 204, 21, 0.28);
}

.timeline-item.kind-error {
    border-color: rgba(248, 113, 113, 0.32);
    background: rgba(34, 10, 18, 0.54);
}

.timeline-item.kind-join {
    border-color: rgba(148, 163, 184, 0.22);
}

@media (max-width: 1279px) {
    #office-stage-canvas { min-height: 460px; }
    .stage-card[data-view-mode="simple"] .office-engine-mount { min-height: 360px; }
    .stage-card[data-view-mode="simple"] #office-stage-canvas { min-height: 360px; }
    #control-office-scene { height: 440px; min-height: 440px; }
    #team-hub-scene { height: 320px; min-height: 320px; }
}

@media (max-width: 860px) {
    #office-stage-canvas { min-height: 260px; }
    .stage-card[data-view-mode="simple"] .office-engine-mount { min-height: 240px; }
    .stage-card[data-view-mode="simple"] #office-stage-canvas { min-height: 240px; }
    #control-office-scene { height: 360px; min-height: 360px; }
    #team-hub-scene { height: 280px; min-height: 280px; }
    .stage-page-shell { padding: 12px; }
    .stage-page-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    #stage-page-canvas {
        height: calc(100vh - 138px);
        min-height: 400px;
    }
}

.office-engine-mount::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(226, 232, 240, 0.22)),
        url('/static/office_bg_small.webp') center / cover no-repeat;
    opacity: 0.18;
    transition: opacity 220ms ease;
}

.office-engine-mount::after {
    content: attr(data-scene-label);
    position: absolute;
    left: 18px;
    right: 18px;
    top: 18px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    color: #0f172a;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    backdrop-filter: blur(6px);
    z-index: 1;
    white-space: pre-line;
    pointer-events: none;
}

.office-engine-mount canvas {
    position: relative;
    z-index: 2;
}

.office-engine-mount[data-scene-ready="true"] canvas {
    opacity: 1;
}

.office-engine-mount[data-scene-ready="true"]::before,
.office-engine-mount[data-scene-ready="true"]::after {
    opacity: 0;
}

