/* 禁用整个页面的选中 */
body {
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* 标准语法 */
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    height: 100vh;
}

/* 如果只想禁用特定元素的选中 */
.no-select {
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* 标准语法 */
}

/* Font Awesome 图标字体定义 */
@font-face {
    font-family: 'Font Awesome 5 Free';
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url("../js/webfonts/fa-solid-900.woff2") format("woff2");
}

.fa {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-style: normal;
}

.fa-bars:before {
    content: "\f0c9";
}

.fa-file:before {
    content: "\f15b";
}

/* 侧边栏样式 */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: all 0.3s ease;
    overflow-x: hidden;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* 侧边栏折叠状态 */
#sidebar.collapsed {
    width: 40px;
}

/* 侧边栏展开状态 */
#sidebar.expanded {
    width: 350px;
}

/* 侧边栏内容 */
#sidebar-content {
    padding: 20px;
    width: 300px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#sidebar.expanded #sidebar-content {
    opacity: 1;
    pointer-events: auto;
}

/* 侧边栏标题 */
.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    margin-top: 15px; /* 新增：为触发器图标留出空间 */
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* 文件信息区域 */
.file-info-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-info-item {
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.file-info-item .file-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.file-info-item .file-details {
    font-size: 12px;
    color: #666;
}

/* 占位内容 */
.placeholder-content {
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* 侧边栏触发器 - 固定在左上角的灰色文字图标 */
#sidebar-trigger {
    position: fixed;
    left: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 1001;
    border: none;
}

#sidebar-trigger:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 侧边栏触发器 - 固定在左上角的灰色文字图标 */
#sidebar-trigger {
    position: fixed;
    left: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 1001;
    border: none;
}

#sidebar-trigger:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* 增强版触发器闪烁动画 - 更显眼 */
#sidebar-trigger.pulse {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        background-color: rgba(76, 175, 80, 0.1);
        color: #4CAF50;
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7), 
                    0 0 0 0 rgba(255, 193, 7, 0.5);
    }
    25% {
        transform: scale(1.3);
        background-color: rgba(76, 175, 80, 0.3);
        color: #ffffff;
        box-shadow: 0 0 0 8px rgba(76, 175, 80, 0.4), 
                    0 0 0 16px rgba(255, 193, 7, 0.3);
    }
    50% {
        transform: scale(1.1);
        background-color: rgba(255, 193, 7, 0.3);
        color: #333;
        box-shadow: 0 0 0 12px rgba(255, 193, 7, 0.2), 
                    0 0 0 24px rgba(76, 175, 80, 0.1);
    }
    75% {
        transform: scale(1.2);
        background-color: rgba(76, 175, 80, 0.4);
        color: #ffffff;
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.5), 
                    0 0 0 12px rgba(255, 193, 7, 0.4);
    }
    100% {
        transform: scale(1);
        background-color: rgba(76, 175, 80, 0.1);
        color: #4CAF50;
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7), 
                    0 0 0 0 rgba(255, 193, 7, 0.5);
    }
}

/* 快速闪烁动画 - 更频繁的闪烁 */
#sidebar-trigger.flash {
    animation: flash 0.8s infinite alternate;
}

@keyframes flash {
    0%, 100% {
        transform: scale(1);
        background-color: rgba(255, 87, 34, 0.8);
        color: white;
        box-shadow: 0 0 20px rgba(255, 87, 34, 0.8);
    }
    50% {
        transform: scale(1.2);
        background-color: rgba(255, 193, 7, 0.9);
        color: #333;
        box-shadow: 0 0 30px rgba(255, 193, 7, 0.9),
                   0 0 40px rgba(255, 193, 7, 0.6);
    }
}

/* 跳动动画 - 上下跳动效果 */
#sidebar-trigger.bounce {
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    0% {
        transform: translateY(0) scale(1);
        background-color: rgba(76, 175, 80, 0.3);
        color: white;
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    }
    100% {
        transform: translateY(-10px) scale(1.2);
        background-color: rgba(255, 193, 7, 0.8);
        color: #333;
        box-shadow: 0 0 25px rgba(255, 193, 7, 0.8),
                   0 5px 15px rgba(0, 0, 0, 0.3);
    }
}

/* 旋转闪烁动画 - 旋转+颜色变化 */
#sidebar-trigger.spin {
    animation: spin 2s infinite linear;
}

@keyframes spin {
    0% {
        transform: rotate(0deg) scale(1);
        background-color: rgba(76, 175, 80, 0.3);
        color: white;
    }
    25% {
        transform: rotate(90deg) scale(1.3);
        background-color: rgba(255, 193, 7, 0.6);
        color: #333;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        background-color: rgba(255, 87, 34, 0.8);
        color: white;
    }
    75% {
        transform: rotate(270deg) scale(1.2);
        background-color: rgba(156, 39, 176, 0.6);
        color: white;
    }
    100% {
        transform: rotate(360deg) scale(1);
        background-color: rgba(76, 175, 80, 0.3);
        color: white;
    }
}

/* 场景容器调整 */
#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    /* 从0开始，因为触发器固定在左上角 */
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: auto;
}

#sidebar.expanded~#scene-container {
    left: 300px;
    width: calc(100vw - 300px);
}

/* 确保Three.js渲染器canvas正确显示 */
#scene-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    pointer-events: auto;
    /* 确保canvas可以接收鼠标事件 */
}

#sliders {
    position: absolute;
    top: 20px;
    /* 距离顶部的距离 */
    left: 20px;
    /* 距离左边的距离 */
    z-index: 1000;
    /* 设置较高的z-index值，确保滑动条覆盖在3D场景之上 */
}

#sliders div {
    margin-bottom: 10px;
    /* 添加一些底部边距，使滑动条之间有间隔 */
}

#sliders label,
#sliders span {
    font-size: 16px;
    /* 设置字体大小 */
    color: #333;
    /* 设置文字颜色 */
    font-family: Arial, sans-serif;
    /* 设置字体家族 */
}

#sliders label {
    display: inline-block;
    /* 设置为inline-block，与span在同一行 */
    margin-right: 10px;
    /* 与span之间添加一些间距 */
    font-weight: bold;
    /* 加粗字体 */
}

#sliders span {
    display: inline-block;
    /* 设置为inline-block，与label在同一行 */
    background-color: #f0f0f0;
    /* 背景颜色 */
    padding: 5px 10px;
    /* 内边距 */
    border-radius: 5px;
    /* 圆角 */
    white-space: nowrap;
    /* 防止文本换行 */
    transition: background-color 0.3s ease;
    /* 平滑过渡效果 */
}

#sliders span:hover {
    background-color: #e0e0e0;
    /* 鼠标悬停时改变背景颜色 */
}

/* 右上角控制按钮容器 */
#controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 控制项样式 */
.control-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.control-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 文件加载按钮样式 */
.file-input-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.file-input-btn:hover {
    background: #45a049;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.file-input-btn:active {
    transform: scale(0.95);
}

/* 侧边栏中的文件输入容器 */
.file-input-container {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* 网格布局 */
.grid-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px;
    align-items: center;
}

.grid-layout span {
    font-size: 12px;
    color: #666;
}

.grid-layout input {
    width: 80px;
    padding: 4px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* 提示内容样式 */
.tips-content {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.tips-content div {
    margin-bottom: 4px;
}

/* 侧边栏展开时隐藏右上角的文件加载按钮 */
#sidebar.expanded ~ #controls #file-input-btn-container {
    display: none;
}

/* 侧边栏收起时隐藏侧边栏中的文件输入 */
#sidebar.collapsed #sidebar-file-input {
    display: none;
}

/* 侧边栏展开时调整控制按钮位置 */
#sidebar.expanded ~ #controls {
    right: 20px;
    top: 20px;
}

/* 按钮样式 */
.control-btn {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    flex: 1;
}

.control-btn:hover {
    background-color: #45a049;
}

/* 隐藏状态的按钮样式 */
.control-btn.hidden {
    background-color: #cccccc;
    color: #666666;
}

.control-btn.hidden:hover {
    background-color: #bbbbbb;
}

/* 滑动条样式 */
input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

input[type="number"] {
    width: 60px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* 添加工具提示样式 */
.tooltip {
    position: absolute;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    white-space: pre-line; /* 支持多行文本 */
    line-height: 1.4;
    max-width: 300px;
    word-wrap: break-word;
}

.fa-file:before {
    content: "\f15b";
}

.fa-eye:before {
    content: "\f06e";
}

.fa-eye-slash:before {
    content: "\f070";
}

.tooltip {
    position: absolute;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    white-space: pre-line; /* 支持多行文本 */
    line-height: 1.4;
    max-width: 300px;
    word-wrap: break-word;
}

/* 文件项布局样式 */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.file-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.file-item.selected {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

.file-info {
    flex: 1;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 显示/隐藏图标样式 */
.visibility-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.visibility-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.visibility-toggle.hidden {
    color: #999;
}

.visibility-toggle.hidden:hover {
    color: #666;
}


/* 版本号水印样式 */
#version-watermark {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.3); /* 半透明黑色 */
    font-family: Arial, sans-serif;
    z-index: 999;
    pointer-events: none; /* 防止干扰交互 */
    user-select: none; /* 防止选中 */
}