/* 层预览UI样式 - 自定义拖动版本 */

#layer-preview-controls {
    display: none !important;
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);  /* 垂直居中 */
    width: 80px;
    z-index: 1000;
}

.layer-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* 层信息显示框 */
.layer-info-box {
    position: absolute;
    right: 90px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    min-width: 70px;
    text-align: center;
    pointer-events: none;
    transition: bottom 0.05s ease;
    z-index: 10;
    transform: translateY(50%);
}

.layer-number {
    font-size: 14px;
    font-weight: bold;
    color: #2196F3;
}

.layer-height-display {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

/* 双端滑块容器 */
.dual-slider-container {
    position: relative;
    width: 20px;
    height: 500px;  /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 滑动条轨道 */
.slider-track {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 100%;
    background: #888888;  /* 灰色（滑块之外的区域） */
    border-radius: 4px;
    z-index: 1;
    pointer-events: none;
}

/* 选中范围填充 */
#slider-range-fill {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    background: #000000;  /* 黑色（两个滑块之间的选中范围） */
    border-radius: 4px;
    bottom: 0;
    height: 0;
    pointer-events: none;
    z-index: 2;
    transition: bottom 0.05s ease, height 0.05s ease;
}

/* 滑块手柄 - 关键样式 */
.slider-thumb {
    position: absolute;
    left: 50%;
    margin-left: -8px;  /* 宽度的一半，用于水平居中：16px / 2 = 8px */
    margin-top: -8px;   /* 高度的一半，用于垂直居中：16px / 2 = 8px */
    width: 16px;   /* 放大到一倍：8px × 2 = 16px */
    height: 16px;  /* 放大到一倍：8px × 2 = 16px */
    background: #2196F3;
    border: 2px solid white;  /* 相应放大边框：1px → 2px */
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: top 0.05s ease, box-shadow 0.2s, background 0.2s;
    z-index: 5;
    /* 确保可点击 */
    pointer-events: auto;
}

.slider-thumb:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.6);
    background: #1E88E5;
}

.slider-thumb:active,
.slider-thumb.dragging {
    cursor: grabbing;
    background: #1565C0;
}

/* 顶部滑块 - 默认在最上面（显示完整模型） */
#slider-thumb-top {
    z-index: 6;
    top: 0%;  /* 0%表示在容器顶部，对应最大层数 */
}

/* 底部滑块 - 默认在最下面 */
#slider-thumb-bottom {
    z-index: 5;
    top: 100%;  /* 100%表示在容器底部，对应第0层 */
}

/* 播放/暂停按钮 */
#play-pause-button {
    width: 22px;  /* 缩小两倍：44px → 22px */
    height: 22px;
    background: #333;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 8px;  /* 相应缩小字体：16px → 8px */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    margin-top: 15px;
}

#play-pause-button:hover {
    background: #555;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

#play-pause-button:active {
    transform: scale(0.95);
}

/* 暗色主题适配 */
body.dark-mode .layer-info-box {
    background: rgba(45, 45, 45, 0.95);
    border-color: #555;
    color: #eee;
}

body.dark-mode .layer-number {
    color: #64B5F6;
}

body.dark-mode .layer-height-display {
    color: #aaa;
}

body.dark-mode #play-pause-button {
    background: #222;
}

body.dark-mode #play-pause-button:hover {
    background: #444;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    #layer-preview-controls {
        right: 20px;
        /* 保持垂直居中，不需要修改 top */
    }
}
