/* ================================================================
   float.css · 浮动专属样式（3D 图层模型）
   ================================================================ */

/* ========== 3D 舞台 ========== */
.stage-3d {
    background: #0a0f1a;
    border-radius: 12px;
    height: 520px;
    position: relative;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 50% 40%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    perspective: 1600px;
    perspective-origin: 50% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stage-3d::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: rotateX(70deg);
    transform-origin: bottom;
    pointer-events: none;
    mask-image: linear-gradient(to top, black, transparent);
    -webkit-mask-image: linear-gradient(to top, black, transparent);
}

/* 场景容器 */
.stage-scene {
    position: relative;
    width: 460px;
    height: 340px;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-scene.isometric {
    transform: rotateX(18deg) rotateY(-14deg);
}

.stage-scene.flat {
    transform: rotateX(0deg) rotateY(0deg);
}

/* ========== 图层平面 ========== */
.layer-plane {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: all 1.1s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.layer-plane .plane-surface {
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(59, 130, 246, 0.35);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.35);
    transition: all 0.8s ease;
    pointer-events: none;
}

.layer-plane .plane-label {
    position: absolute;
    top: -26px;
    left: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--bg-tertiary);
    white-space: nowrap;
    transition: all 0.6s ease;
}

.layer-plane.flow .plane-surface {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(30, 58, 95, 0.18);
}

.layer-plane.flow .plane-label {
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.4);
}

.layer-plane.float .plane-surface {
    border-color: rgba(6, 182, 212, 0.8);
    border-style: solid;
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.2),
                inset 0 0 30px rgba(6, 182, 212, 0.05);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.layer-plane.float.active .plane-surface {
    opacity: 1;
}

.layer-plane.float .plane-label {
    color: var(--accent-cyan);
    border-color: rgba(6, 182, 212, 0.6);
    background: rgba(6, 182, 212, 0.15);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.layer-plane.float.active .plane-label {
    opacity: 1;
}

/* ========== 浮动图层内元素布局 ========== */
.float-layer-container {
    position: absolute;
    inset: 0;
    padding: 40px 30px;
    display: flex;
    align-content: flex-start;
    gap: 20px;
    pointer-events: none;
}

.float-layer-container.float-left-group {
    justify-content: flex-start;
}

.float-layer-container.float-right-group {
    justify-content: flex-end;
}

/* ========== 元素 ========== */
.elem {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
    flex-shrink: 0;
}

.elem.elem-a { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.elem.elem-b { background: linear-gradient(135deg, #10b981, #059669); }
.elem.elem-c { background: linear-gradient(135deg, #f59e0b, #d97706); }

.elem.floating {
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.35),
                0 0 0 2px rgba(6, 182, 212, 0.5);
}

/* ========== 文档流图层布局 ========== */
.flow-container {
    position: absolute;
    inset: 0;
    padding: 40px 30px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 20px;
}

/* ========== 文字 ========== */
.text-flow {
    position: absolute;
    left: 30px;
    right: 30px;
    top: 150px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
    transition: all 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.text-flow p { margin-bottom: 6px; }

/* ========== 共享浮动图层卡片 ========== */
.shared-float-layer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.shared-float-layer .shared-thumb {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.shared-float-layer .mini-thumb {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 10px;
    color: white;
}

.shared-float-layer .layer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-cyan);
}

.shared-float-layer .layer-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== 图例 ========== */
.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-swatch.flow-swatch {
    border: 2px dashed var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.legend-swatch.float-swatch {
    border: 2px solid var(--accent-cyan);
    background: rgba(6, 182, 212, 0.15);
}