/* codex: 2026-11-13 4x4折纸工作台、网格单元、折痕虚线与3D透视堆叠样式表 */

.board-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    min-height: 420px;
}

.paper-board-container {
    position: relative;
    width: 360px;
    height: 360px;
    max-width: 90vw;
    max-height: 90vw;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

/* 3D 视角转换 */
.paper-board-container.perspective-3d {
    transform: perspective(900px) rotateX(42deg) rotateZ(-18deg) scale(0.9);
}

.paper-board {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    gap: 3px;
    background: #c5b8a5;
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transform-style: preserve-3d;
}

/* 单元格纸片 */
.paper-cell {
    position: relative;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px dashed rgba(0, 0, 0, 0.15);
    transform-style: preserve-3d;
}

.paper-cell:hover {
    filter: brightness(1.05);
}

.paper-cell.selected {
    outline: 3px solid #d81b60;
    outline-offset: -2px;
}

.cell-top-id {
    font-size: 1.25rem;
    font-weight: 800;
    color: inherit;
    line-height: 1;
}

.cell-orig-coord {
    font-size: 0.72rem;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 2px;
}

.cell-layer-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #d81b60;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 折痕覆盖层 */
.crease-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform-style: preserve-3d;
}

/* 垂直与水平折痕线 */
.crease-line {
    position: absolute;
    pointer-events: auto;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crease-vertical {
    top: 0;
    width: 20px;
    height: 100%;
    transform: translateX(-50%);
    border-left: 2px dashed rgba(216, 27, 96, 0.7);
    cursor: col-resize;
}

.crease-vertical:hover {
    border-left: 3px solid #d81b60;
    background: rgba(216, 27, 96, 0.08);
}

.crease-horizontal {
    left: 0;
    height: 20px;
    width: 100%;
    transform: translateY(-50%);
    border-top: 2px dashed rgba(216, 27, 96, 0.7);
    cursor: row-resize;
}

.crease-horizontal:hover {
    border-top: 3px solid #d81b60;
    background: rgba(216, 27, 96, 0.08);
}

/* 折叠手柄箭头按键 */
.fold-arrow-btn {
    position: absolute;
    background: #ffffff;
    color: #d81b60;
    border: 1.5px solid #d81b60;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: all 0.15s ease;
    white-space: nowrap;
    opacity: 0.92;
}

.fold-arrow-btn:hover {
    background: #d81b60;
    color: #ffffff;
    transform: scale(1.1);
    opacity: 1;
}

/* 垂直折痕按钮定位 */
.crease-vertical .fold-arrow-right {
    top: -24px;
    left: 8px;
}
.crease-vertical .fold-arrow-left {
    bottom: -24px;
    left: -48px;
}

/* 水平折痕按钮定位 */
.crease-horizontal .fold-arrow-down {
    left: -65px;
    top: 8px;
}
.crease-horizontal .fold-arrow-up {
    right: -65px;
    top: -20px;
}

/* 皮肤差异微调 */
.paper-board-container.skin-cyber .paper-board {
    background: #0b1d30;
    box-shadow: 0 10px 30px rgba(72, 199, 242, 0.15);
}
.paper-board-container.skin-cyber .cell-orig-coord {
    color: rgba(255, 255, 255, 0.6);
}
.paper-board-container.skin-cyber .crease-vertical {
    border-left-color: rgba(72, 199, 242, 0.8);
}
.paper-board-container.skin-cyber .crease-horizontal {
    border-top-color: rgba(72, 199, 242, 0.8);
}
