/* ==================== 3D查看器样式 ==================== */
/* 版本: 2.0.0 - Three.js FBX支持 */

.viewer3d-modal .modal {
    max-width: 90vw;
    width: 1200px;
    height: 85vh;
}

.viewer3d-container {
    position: relative;
    width: 100%;
    height: calc(85vh - 70px);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewer3dCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
    outline: none;
    border: none;
}

#viewer3dCanvas:active {
    cursor: grabbing;
}

/* ==================== 加载提示 ==================== */
.viewer3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: white;
}

.viewer3d-loading i {
    font-size: 48px;
    color: var(--secondary);
    margin-bottom: 16px;
}

.viewer3d-loading p {
    font-size: 16px;
    margin-bottom: 24px;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
    transition: width 0.3s ease;
    width: 0%;
}

.loading-percent {
    font-size: 14px;
    color: var(--text-muted);
}

/* ==================== 操作提示 ==================== */
.viewer3d-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    z-index: 50;
    transition: opacity 0.5s ease;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 13px;
}

.hint-item i {
    color: var(--secondary);
}

/* ==================== 顶部工具栏 ==================== */
.viewer3d-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 50;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toolbar-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* ==================== 动画控制栏 ==================== */
.viewer3d-animation-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    z-index: 50;
    min-width: 400px;
}

.anim-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.anim-btn:hover {
    background: var(--secondary-light);
    transform: scale(1.1);
}

.anim-btn:active {
    transform: scale(0.95);
}

.anim-info {
    display: flex;
    flex-direction: column;
    color: white;
    font-size: 12px;
    min-width: 100px;
}

.anim-info span:first-child {
    font-weight: 600;
    color: var(--secondary);
}

.anim-info span:last-child {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.anim-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    margin: 0 8px;
}

.anim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.anim-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    background: var(--secondary-light);
}

.anim-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--secondary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ==================== 触摸设备优化 ==================== */
@media (pointer: coarse) {
    .viewer3d-hint {
        top: 80px;
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }
    
    .hint-item {
        font-size: 12px;
    }
    
    .viewer3d-animation-controls {
        min-width: auto;
        width: calc(100% - 40px);
        padding: 10px 16px;
    }
    
    .anim-info {
        display: none;
    }
}

/* ==================== 全屏模式 ==================== */
.viewer3d-container:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.viewer3d-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .viewer3d-modal .modal {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }
    
    .viewer3d-container {
        height: calc(100vh - 70px);
        border-radius: 0;
    }
    
    .viewer3d-toolbar {
        top: 10px;
        right: 10px;
    }
    
    .toolbar-btn {
        width: 36px;
        height: 36px;
    }
    
    .viewer3d-animation-controls {
        bottom: 10px;
        padding: 8px 12px;
    }
    
    .anim-btn {
        width: 36px;
        height: 36px;
    }
}
