/* fullscreen.css - 全屏缩放样式（完整版：8方向缩放+旋转+双指手势） */

/* 全局全屏容器样式 */
.fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
    z-index: 1;
}

/* 防止body滚动 */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

/* 主容器样式 - 确保没有额外的 margin/padding */
.fullscreen-container .mymain {
    position: relative;
    transform-origin: 0 0;
    background-color: #000;
    will-change: transform;
    margin: 0;
    padding: 0;
}

/* 背景图片 */
.mymain .mybg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.mymain .mybg img,
.mymain .mybg .bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mymain .mybg object,
.mymain .mybg embed {
    width: 100%;
    height: 100%;
}

/* ========== 祭品容器基础样式 ========== */
.divWrap {
    position: absolute;
    box-sizing: border-box;
    display: inline-block;
    line-height: 0;
    font-size: 0;
}

/* 父容器相对定位 */
.mymain {
    position: relative;
    overflow: hidden;
    width: 1150px;
    height: 600px;
}

/* 祭品内部图片样式 - 允许拉伸变形 */
.divWrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;  /* fill = 强制拉伸填充，不保持比例 */
}

/* 祭品容器内的 div1 用于捕获事件 */
.divWrap .div1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ========== 8方向缩放控制点完整样式 ========== */
.resize-handle {
    position: absolute !important;
    background-color: #fff !important;
    border: 2px solid #ff6600 !important;
    border-radius: 50% !important;
    z-index: 10001 !important;
    box-shadow: 0 0 4px rgba(0,0,0,0.5) !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
    transition: transform 0.1s ease, background 0.1s ease;
}

.resize-handle:active {
    transform: scale(1.2);
    background-color: #ff6600 !important;
}

/* 8个方向定位 - 默认PC端尺寸10px */
.resize-nw { left: -5px !important; top: -5px !important; cursor: nw-resize !important; }
.resize-n { left: 50% !important; top: -5px !important; margin-left: -5px !important; cursor: n-resize !important; }
.resize-ne { right: -5px !important; top: -5px !important; cursor: ne-resize !important; }
.resize-e { right: -5px !important; top: 50% !important; margin-top: -5px !important; cursor: e-resize !important; }
.resize-se { right: -5px !important; bottom: -5px !important; cursor: se-resize !important; }
.resize-s { left: 50% !important; bottom: -5px !important; margin-left: -5px !important; cursor: s-resize !important; }
.resize-sw { left: -5px !important; bottom: -5px !important; cursor: sw-resize !important; }
.resize-w { left: -5px !important; top: 50% !important; margin-top: -5px !important; cursor: w-resize !important; }

/* 旋转控制点样式 */
.rotate-handle {
    position: absolute !important;
    background-color: #fff !important;
    border: 2px solid #3399ff !important;
    border-radius: 50% !important;
    top: -28px !important;
    left: 50% !important;
    margin-left: -10px !important;
    width: 20px !important;
    height: 20px !important;
    z-index: 10001 !important;
    cursor: grab !important;
    box-shadow: 0 0 4px rgba(0,0,0,0.5) !important;
    text-align: center !important;
    line-height: 18px !important;
    font-size: 12px !important;
    color: #3399ff !important;
    box-sizing: border-box !important;
    transition: transform 0.1s ease, background 0.1s ease;
}

.rotate-handle:active {
    transform: scale(1.2);
    background-color: #3399ff !important;
    color: #fff !important;
    cursor: grabbing !important;
}

/* 手机端控制点尺寸适配 */
@media (max-width: 768px) {
    .resize-handle {
        width: 14px !important;
        height: 14px !important;
        border-width: 2px !important;
    }
    .resize-nw { left: -8px !important; top: -8px !important; }
    .resize-n { left: 50% !important; top: -8px !important; margin-left: -8px !important; }
    .resize-ne { right: -8px !important; top: -8px !important; }
    .resize-e { right: -8px !important; top: 50% !important; margin-top: -8px !important; }
    .resize-se { right: -8px !important; bottom: -8px !important; }
    .resize-s { left: 50% !important; bottom: -8px !important; margin-left: -8px !important; }
    .resize-sw { left: -8px !important; bottom: -8px !important; }
    .resize-w { left: -8px !important; top: 50% !important; margin-top: -8px !important; }
    
    .rotate-handle {
        width: 24px !important;
        height: 24px !important;
        top: -34px !important;
        margin-left: -12px !important;
        line-height: 22px !important;
        font-size: 14px !important;
    }
}

/* 拖动时隐藏控制点（避免干扰） */
.divWrap.dragging .resize-handle,
.divWrap.dragging .rotate-handle {
    opacity: 0.5;
    pointer-events: none;
}

/* 控制点显示控制 - 只有创建者且编辑模式开启才显示 */
body.creator-mode .divWrap1.jp-edit-enabled .resize-handle,
body.creator-mode .divWrap1.jp-edit-enabled .rotate-handle {
    display: block !important;
}

body.creator-mode .tombstone-avatar.divWrap1.edit-mode-enabled .resize-handle,
body.creator-mode .tombstone-avatar.divWrap1.edit-mode-enabled .rotate-handle,
body.creator-mode .tombstone-name.divWrap1.edit-mode-enabled .resize-handle,
body.creator-mode .tombstone-name.divWrap1.edit-mode-enabled .rotate-handle {
    display: block !important;
}

/* 默认隐藏控制点 */
.resize-handle, .rotate-handle {
    display: none !important;
}

/* 编辑模式下隐藏提示框 */
.divWrap.jp-edit-enabled .div2,
.divWrap.edit-mode-enabled .div2 {
    display: none !important;
}

/* 拖动时隐藏信息框 */
.divWrap.dragging .div2 {
    display: none !important;
}

/* 墓碑头像和名字容器 */
.tombstone-avatar .div2,
.tombstone-name .div2 {
    display: none !important;
}

/* ========== 游客模式点击区域优化 ========== */
body:not(.creator-mode) .divWrap {
    cursor: pointer;
}

body:not(.creator-mode) .divWrap img {
    pointer-events: auto;
}

/* ========== 悬浮工具栏 ========== */
.floating-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    padding: 8px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 1px solid rgba(255, 102, 0, 0.4);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.floating-toolbar a {
    color: #ddd;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
    display: inline-block;
    white-space: nowrap;
    font-family: "Microsoft YaHei",微软雅黑;
    letter-spacing: 1px;
}

.floating-toolbar a:hover {
    background: #ff6600;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.floating-toolbar a:active {
    transform: translateY(0);
}

.floating-toolbar a:first-child {
    background: rgba(255, 68, 68, 0.2);
    color: #ff8888;
}
.floating-toolbar a:first-child:hover {
    background: #ff4444;
    color: #fff;
}

/* ========== 悬浮控制栏 ========== */
.floating-control-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.floating-control-bar .control-title {
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
}

.floating-control-bar .control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.floating-control-bar .edit-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    background: #555;
    color: #fff;
}

.floating-control-bar .edit-btn-primary {
    background: #ff6600;
    color: #fff;
}

.floating-control-bar .edit-btn-active {
    background: #4caf50;
    color: #fff;
}

.floating-control-bar .edit-btn-inactive {
    background: #f44336;
    color: #fff;
    opacity: 0.7;
}

.floating-control-bar .edit-btn:hover {
    transform: translateY(-2px);
}

.floating-control-bar .drag-handle {
    cursor: move;
    text-align: center;
    padding: 5px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 缩放提示 */
.zoom-indicator {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #ffd700;
    font-family: monospace;
    pointer-events: none;
}

/* ========== 竖排文字样式 ========== */
.vertical-text {
    width: 14px;
    font-size: 14px;
    color: #fff;
    font-weight: 700;
    margin: 5px 0 0 0;
    float: left;
    margin-left: 8px;
    line-height: 15px;
}

/* 墓碑名字容器 */
.tombstone-name {
    position: absolute;
    cursor: move;
    z-index: 10;
}

/* 墓碑头像容器 */
.tombstone-avatar {
    position: absolute;
    cursor: move;
    z-index: 10;
}

/* 墓碑头像图片圆角样式 */
.tombstone-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

/* ========== 提示框美化 ========== */
.div2 {
    position: absolute !important;
    bottom: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-bottom: 10px !important;
    z-index: 10001 !important;
    background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(30,25,20,0.95) 100%) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    color: #f5e6c8 !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    min-width: 160px !important;
    max-width: 260px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,193,7,0.3) inset !important;
    border: none !important;
    pointer-events: none !important;
    text-align: center !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.div2::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-width: 7px 7px 0 7px !important;
    border-style: solid !important;
    border-color: rgba(255,193,7,0.6) transparent transparent transparent !important;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)) !important;
}

.div2 .feng {
    color: #ffc107 !important;
    font-weight: bold !important;
    font-size: 13px !important;
    display: inline-block !important;
    margin: 0 2px !important;
}

.div2 .red {
    color: #ff8888 !important;
    font-size: 11px !important;
    display: inline-block !important;
}

.div2 .validity-text {
    display: block !important;
    margin-top: 5px !important;
    padding-top: 4px !important;
    border-top: 1px dashed rgba(255,193,7,0.3) !important;
    font-size: 11px !important;
    color: #ccaa88 !important;
}

/* ========== 手机端全局适配 ========== */
@media (max-width: 768px) {
    .floating-toolbar {
        padding: 6px 12px;
        gap: 6px;
    }
    
    .floating-toolbar a {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .floating-control-bar {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        min-width: 160px;
    }
    
    .floating-control-bar .edit-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .zoom-indicator {
        bottom: 55px;
        right: 10px;
        font-size: 10px;
        padding: 2px 8px;
    }
    
    /* 移动端触摸优化 */
    .divWrap {
        touch-action: none !important;
    }
    
    /* 移动端提示框调整 */
    .div2 {
        font-size: 11px !important;
        padding: 8px 12px !important;
        min-width: 140px !important;
        max-width: 200px !important;
    }
    .div2 .feng {
        font-size: 12px !important;
    }
}

/* ========== 移动端弹窗适配 ========== */
@media screen and (max-width: 768px) {
    .layui-layer-page .layui-layer-content,
    .layui-layer-iframe iframe {
        width: 100% !important;
        max-width: 100vw !important;
    }
    .layui-layer-page {
        width: 95% !important;
        max-width: 95% !important;
        left: 2.5% !important;
        right: 2.5% !important;
        margin-left: 0 !important;
    }
    .layui-layer-iframe {
        width: 100% !important;
        height: 85vh !important;
        max-height: 85vh !important;
    }
    .layui-layer-iframe iframe {
        height: 85vh !important;
    }
}

@media screen and (max-width: 768px) {
    .layui-layer-page {
        width: 92% !important;
        left: 4% !important;
        border-radius: 16px !important;
    }
    .layui-layer-iframe {
        height: 85vh !important;
        border-radius: 16px !important;
        overflow: hidden !important;
    }
    .layui-layer-close {
        width: 30px !important;
        height: 30px !important;
        line-height: 30px !important;
        font-size: 20px !important;
        right: 1px !important;
        top: 30px !important;
    }
}

/* 祭品悬浮效果 */
.divWrap:not(.tombstone-avatar):not(.tombstone-name):hover {
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.5));
}

/* 置顶动画效果 */
.divWrap.top-layer {
    filter: drop-shadow(0 0 8px rgba(255,215,0,0.8));
    transition: filter 0.1s ease;
}

/* 拖动效果 */
.divWrap {
    transition: transform 0.05s ease;
}

/* 编辑状态下墓碑元素指针 */
.tombstone-avatar.edit-mode-enabled,
.tombstone-name.edit-mode-enabled {
    cursor: move;
}

.tombstone-avatar:not(.edit-mode-enabled),
.tombstone-name:not(.edit-mode-enabled) {
    cursor: default;
}

/* ========== 双指手势视觉反馈 ========== */
.divWrap.pinch-active {
    transition: none;
}

.divWrap.pinch-active .resize-handle,
.divWrap.pinch-active .rotate-handle {
    opacity: 0.3;
}

/* 编辑模式激活时的视觉提示 */
.divWrap1.jp-edit-enabled,
.tombstone-avatar.edit-mode-enabled,
.tombstone-name.edit-mode-enabled {
    outline: 1px dashed rgba(255, 215, 0, 0.3);
    outline-offset: 2px;
}

/* 拖拽时的视觉反馈 */
.divWrap.dragging {
    opacity: 0.95;
    filter: drop-shadow(0 0 6px rgba(255,215,0,0.6));
    transition: none;
}

/* 控制点悬停效果 */
.resize-handle:hover {
    transform: scale(1.15);
    background-color: #ff6600 !important;
    border-color: #fff !important;
}

.rotate-handle:hover {
    transform: scale(1.15);
    background-color: #3399ff !important;
    color: #fff !important;
}
/* 禁止图片被拖拽到浏览器地址栏 */
.divWrap img,
.tombstone-avatar img,
.mymain img {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-drag: none;
    user-select: none;
    pointer-events: auto;
}

/* 禁用图片选中和拖拽 */
img {
    draggable: false;
    -webkit-tap-highlight-color: transparent;
}