/* 折纸展开动画模式 */
.stage.stage-origami {
    overflow: visible;
    perspective: 1400px;
    perspective-origin: 50% 50%;
}
.stage.stage-origami .stage-tiles {
    opacity: 0;
    pointer-events: none;
}
.stage.stage-origami::after {
    display: none;
}

/* 折纸容器 */
.origami-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120vmax;
    height: 120vmax;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    z-index: 1;
    will-change: transform;
    opacity: 0;
}

/* 内容层：承载完整图墙克隆 */
.origami-content {
    position: absolute;
    inset: 0;
    overflow: hidden;
    will-change: clip-path;
    contain: layout style;
}

/* 内容层的瓷砖 */
.origami-content .stage-tiles {
    opacity: 1 !important;
    pointer-events: none;
    position: absolute;
    inset: auto;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    transform: translate(-50%, -50%) rotate(-15deg) scale(1.3);
}

/* ── 翻板：带真实内容的纸面，3D翻转 ── */
.origami-flap {
    position: absolute;
    backface-visibility: hidden;
    z-index: 5;
    will-change: transform, opacity;
    transform-style: preserve-3d;
    overflow: hidden;
    contain: layout style paint;
    background: linear-gradient(135deg,
        rgba(38, 36, 62, 0.97) 0%,
        rgba(50, 46, 78, 0.94) 35%,
        rgba(30, 28, 52, 0.98) 100%
    );
}

/* 翻板内的克隆内容（仅桌面端） */
.origami-flap .flap-content {
    position: absolute;
    pointer-events: none;
    opacity: 1 !important;
    contain: strict;
}
.origami-flap .flap-content .stage-tiles {
    opacity: 1 !important;
    pointer-events: none;
    position: absolute;
    inset: auto;
    width: 120vmax;
    height: auto;
}
@media (max-width: 768px) {
    .origami-flap .flap-content { display: none; }
}

/* 翻板上的光照渐变层 */
.origami-flap .flap-lighting {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    will-change: opacity;
}

/* 右半页翻板 */
.origami-flap-h {
    top: 0;
    left: 50%;
    right: 0;
    bottom: 0;
    transform-origin: left center;
    border-left: 1px solid rgba(255,255,255,0.06);
}
/* 右翻板的内容定位：相对翻板左边缘偏移，使图案对齐 */
.origami-flap-h .flap-content {
    top: 50%;
    left: 0;
    transform: translate(-100%, -50%) rotate(-15deg) scale(1.3);
}
.origami-flap-h .flap-lighting {
    background: linear-gradient(to right,
        rgba(0,0,0,0.4) 0%,
        rgba(0,0,0,0.1) 40%,
        transparent 100%
    );
}

/* 下半页翻板 */
.origami-flap-v {
    left: 0;
    right: 0;
    top: 50%;
    bottom: 0;
    transform-origin: center top;
    border-top: 1px solid rgba(255,255,255,0.06);
}
/* 下翻板的内容定位 */
.origami-flap-v .flap-content {
    left: 50%;
    top: 0;
    transform: translate(-50%, -100%) rotate(-15deg) scale(1.3);
}
.origami-flap-v .flap-lighting {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.4) 0%,
        rgba(0,0,0,0.1) 40%,
        transparent 100%
    );
}

/* ── 投射阴影：翻板在下方内容上的真实投影 ── */
.origami-cast-shadow {
    position: absolute;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    will-change: opacity;
}
.origami-cast-shadow-h {
    top: 0;
    left: 0;
    width: 50%;
    bottom: 0;
    background: linear-gradient(to left,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0.3) 30%,
        transparent 70%
    );
}
.origami-cast-shadow-v {
    left: 0;
    right: 0;
    top: 0;
    height: 50%;
    background: linear-gradient(to top,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0.3) 30%,
        transparent 70%
    );
}

/* ── 折痕阴影线 + 高光 ── */
.origami-fold-line {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    will-change: opacity;
}
.fold-line-v {
    top: 1%;
    bottom: 1%;
    left: 50%;
    width: 6px;
    transform: translateX(-50%);
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0,0,0,0.7) 8%,
        rgba(0,0,0,0.9) 50%,
        rgba(0,0,0,0.7) 92%,
        transparent 100%
    );
    box-shadow: 0 0 30px 10px rgba(0,0,0,0.3),
                2px 0 0 rgba(255,255,255,0.04),
                -2px 0 0 rgba(255,255,255,0.04);
}
.fold-line-h {
    left: 1%;
    right: 1%;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0,0,0,0.7) 8%,
        rgba(0,0,0,0.9) 50%,
        rgba(0,0,0,0.7) 92%,
        transparent 100%
    );
    box-shadow: 0 0 30px 10px rgba(0,0,0,0.3),
                0 2px 0 rgba(255,255,255,0.04),
                0 -2px 0 rgba(255,255,255,0.04);
}

/* 阴影层 */
.origami-shadow {
    position: absolute;
    inset: 5%;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.5);
    filter: blur(50px);
    z-index: -1;
    will-change: opacity, transform;
}
