/* 全局样式重置 */
body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: #333; color: #fff; }
#canvas-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; cursor: grab; }
#canvas-container:active { cursor: grabbing; }

/* 坐标轴容器 - 右上角的隐藏 */
#axis-helper-container { display: none; }

/* 底部坐标轴容器 */
#bottom-axis-container { 
    position: fixed; 
    bottom: 50px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 100px; 
    height: 100px; 
    pointer-events: none; 
    z-index: 10;
}
#bottom-axis-container canvas { 
    pointer-events: auto; 
    cursor: pointer; 
}

/* 加载进度条样式 */
#loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; z-index: 100; opacity: 1; transition: opacity 0.5s ease; pointer-events: none; }
#loading-overlay.hidden { opacity: 0; }
#loading-overlay.visible { pointer-events: auto; }
#loading-bar { width: 80%; max-width: 400px; height: 4px; background-color: rgba(255, 255, 255, 0.3); border-radius: 2px; overflow: hidden; }
#loading-bar::before { content: ''; display: block; height: 100%; width: var(--progress, 0%); background-color: #007bff; border-radius: 2px; transition: width 0.2s ease-out; }

/* UI面板动画和隐藏样式 */
#ui-panel, #right-controls, #floating-buttons {
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
}
.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 滚动条隐藏样式 */
#ui-panel::-webkit-scrollbar,
#right-controls::-webkit-scrollbar {
    display: none;
}

#ui-panel,
#right-controls {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 左侧UI面板 */
#ui-panel { 
    position: absolute; 
    top: 20px; 
    left: 20px; 
    background: rgba(30, 30, 30, 0.85); 
    border-radius: 10px; 
    padding: 15px 20px; 
    width: 200px; /* MODIFIED: 宽度已调窄 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    max-height: calc(100vh - 40px); 
    overflow-y: auto; 
}

#ui-panel.hidden {
    transform: translateX(-100%);
}

h1 { 
    font-size: 1.3em; 
    margin-top: 0; 
    margin-bottom: 15px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ADDED: 用户等级显示样式 */
.user-level {
    font-size: 0.7em;
    font-weight: normal;
    color: #00aaff;
    background-color: rgba(0, 170, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: middle;
}

/* 可折叠菜单样式 */
.collapsible-header { 
    font-size: 1.0em; 
    margin-top: 15px; 
    margin-bottom: 10px; 
    color: #ccc; 
    cursor: pointer; 
    position: relative; 
    padding-right: 20px; 
    user-select: none;
}
.collapsible-header::after { 
    content: '▲'; 
    position: absolute; 
    right: 0; 
    font-size: 0.8em; 
    transition: transform 0.3s ease; 
}
.collapsible-header.collapsed::after { 
    transform: rotate(180deg); 
}
.collapsible-content { 
    max-height: 1000px; 
    overflow: hidden; 
    transition: max-height 0.4s ease-in-out; 
}
.collapsible-content.collapsed { 
    max-height: 0; 
}

/* 模型行布局 - 每行两个按钮 */
.model-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.model-row .model-btn {
    flex: 1;
    margin-bottom: 0;
}

/* 通用按钮样式 */
button { 
    background-color: rgba(255, 255, 255, 0.1); 
    color: #fff; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 5px; 
    cursor: pointer; 
    transition: background-color 0.2s ease, transform 0.1s ease; 
}
button:hover { background-color: rgba(255, 255, 255, 0.2); }
button:active { background-color: rgba(255, 255, 255, 0.3); transform: scale(0.98); }
button.active { background-color: #007bff; border-color: #007bff; font-weight: bold; }

/* 左侧模型按钮 */
.model-btn { 
    padding: 8px 12px; 
    font-size: 0.9em; 
    text-align: center; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* MODIFIED: 快捷键提醒区块 (隐藏) */
#shortcut-hints {
    display: none;
}

.hint-item {
    font-size: 0.8em;
    color: #ccc;
    text-align: center;
    line-height: 1.4;
}

/* 右侧控件 */
#right-controls { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: stretch; 
    gap: 10px; 
    width: 200px; 
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

#right-controls.hidden {
    transform: translateX(100%);
}

/* 浮动按钮容器 */
#floating-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.85);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    gap: 8px;
    z-index: 20;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#floating-buttons.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 20px);
}

#floating-buttons button {
    background: none;
    border: none;
    color: #fff;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#floating-buttons button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#floating-buttons svg {
    width: 20px;
    height: 20px;
}

.control-group { 
    background: rgba(30, 30, 30, 0.85); 
    border-radius: 10px; 
    padding: 10px 15px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 15px; 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 0.9em; 
}

/* 移除 control-group 内 h3 的默认边距以修复对齐问题 */
.control-group h3 {
    margin: 0 !important; /* 强制移除边距 */
    font-weight: normal;
    font-size: 1em;
    line-height: 1; /* 精确控制行高 */
}

#reset-view-btn { 
    width: 100%; 
    padding: 8px 15px; 
    text-align: center; 
    background: rgba(30, 30, 30, 0.85); 
    font-size: 0.9em; 
}

#reset-lights-btn {
    width: 100%;
    padding: 6px 12px;
    margin-top: 8px;
    text-align: center;
    font-size: 0.85em;
}

/* 权限控制样式 */
.premium-feature.locked, .premium-model.locked {
    opacity: 0.6;
    pointer-events: none;
}
.premium-feature .premium-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.7em;
    opacity: 0.8;
    z-index: 10;
}

.free-feature {
    /* 免费功能的样式 */
}

/* 开关样式 */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch.small { width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { 
    position: absolute; 
    cursor: pointer; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background-color: #ccc; 
    transition: .4s; 
    border-radius: 28px; 
}
.switch.small .slider { border-radius: 22px; }
.slider:before { 
    position: absolute; 
    content: ""; 
    height: 20px; 
    width: 20px; 
    left: 4px; 
    bottom: 4px; 
    background-color: white; 
    transition: .4s; 
    border-radius: 50%; 
}
.switch.small .slider:before { height: 16px; width: 16px; left: 3px; bottom: 3px; }
input:checked + .slider { background-color: #007bff; }
input:checked + .slider:before { transform: translateX(22px); }
.switch.small input:checked + .slider:before { transform: translateX(18px); }

/* 右侧垂直控件组样式 */
.control-group-column { 
    background: rgba(30, 30, 30, 0.85); 
    border-radius: 10px; 
    padding: 10px 15px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 0.9em;
}

.control-group-column h3 { 
    margin: 0 0 10px 0;
    font-size: 1em;
    font-weight: 600;
    color: #ddd;
}

.button-group { display: flex; gap: 8px; }
.button-group.two-rows { flex-wrap: wrap; }
.button-group.two-rows > button { flex-basis: calc(33.333% - 6px); }

.button-group > button { flex-grow: 1; text-align: center; padding: 6px; font-size: 0.9em; }
.button-group > .active { background-color: #007bff; border-color: #007bff; font-weight: bold; }

#clipping-controls {
    display: none;
    gap: 12px;
}

.axis-controls {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.axis-controls:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.light-control { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.light-options { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

input[type="color"] { 
    -webkit-appearance: none; 
    -moz-appearance: none; 
    appearance: none; 
    width: 22px; 
    height: 22px; 
    background-color: transparent; 
    border: none; 
    cursor: pointer; 
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { 
    border: 1px solid rgba(255, 255, 255, 0.3); 
    border-radius: 4px; 
}

.slider-container { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    margin-top: 5px;
}
.slider-container span { 
    flex-shrink: 0; 
    width: 50px; 
    font-size: 0.9em;
}

input[type="range"] { 
    flex-grow: 1; 
    -webkit-appearance: none; 
    appearance: none; 
    width: 100%; 
    height: 4px; 
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 2px;
    outline: none; 
    opacity: 0.7; 
    transition: opacity .2s;
}
.light-options input[type="range"] { 
    width: 80px;
}
input[type="range"]::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 16px; 
    height: 16px; 
    background: #ffffff; 
    cursor: pointer; 
    border-radius: 50%;
}
input[type="range"]::-moz-range-thumb { 
    width: 16px; 
    height: 16px; 
    background: #ffffff; 
    cursor: pointer; 
    border-radius: 50%;
}

.color-swatches-container { 
    display: flex; 
    justify-content: space-around; 
    padding: 5px 0;
}
.color-swatch { 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    cursor: pointer; 
    border: 2px solid transparent; 
    transition: transform 0.2s, border-color 0.2s;
}
.color-swatch:hover { 
    transform: scale(1.1);
}

.color-swatch.active { 
    border-color: #007bff;
    transform: scale(1.1);
}

#clipping-slider-container { 
    background: rgba(40, 40, 40, 0.8); 
    padding: 10px 15px; 
    border-radius: 8px; 
    margin-top: 5px; 
    display: none;
}
#clipping-slider-container.visible { 
    display: block;
}

/* 全屏按钮样式 */
#fullscreen-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}
#fullscreen-toggle:hover {
    background-color: rgba(50, 50, 50, 0.9);
}

#fullscreen-toggle svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}
#fullscreen-toggle.active {
    /* 可以在激活时改变样式，例如背景色 */
}

#footer { 
    position: fixed; 
    bottom: 10px; 
    left: 50%; 
    transform: translateX(-50%); 
    font-size: 0.8em; 
    color: rgba(255, 255, 255, 0.5); 
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); 
    pointer-events: none;
    z-index: 1; 
}

.premium-badge {
    color: #ffd700;
    font-size: 1.1em;
    margin-left: 5px;
}

.premium-model {
    /* 付费模型按钮样式 */
}
.premium-model:hover {
    /* 悬停效果 */
}

/* 默认隐藏手机端浮动按钮 */
#mobile-floating-buttons {
    display: none;
}


/* 升级弹窗 */
#upgrade-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none; /* 默认隐藏 */
}

.modal-overlay {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #282c34;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}
.modal-close:hover {
    color: #fff;
}


.modal-body {
    padding-top: 20px;
}
.modal-body p {
    font-size: 1em;
    color: #ccc;
    margin-bottom: 15px;
}
.modal-body ul {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
}
.modal-body li {
    padding: 8px 0;
    font-size: 0.95em;
    color: #ddd;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.modal-body li:last-child {
    border-bottom: none;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}
.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
}


.btn-secondary {
    background: transparent;
    color: #ccc;
    border: 1px solid #555;
}
.btn-secondary:hover {
    background: #333;
    color: #fff;
    border-color: #777;
}

/* 手机端样式 - 简化版本 */
@media (max-width: 768px) {
    /* 隐藏手机端不需要的元素 */
    #mobile-toolbar {
        display: none;
    }
    
    .mobile-overlay {
        display: none;
    }
    
    /* 工具栏在手机端的布局调整 */
    #ui-panel {
        position: fixed;
        top: 10px;
        left: 10px;
        width: calc(40% - 15px);
        max-height: calc(100vh - 20px);
        z-index: 30;
    }
    
    #right-controls {
        position: fixed;
        top: 10px;
        right: 10px;
        width: calc(50% - 15px);
        max-height: calc(100vh - 20px);
        z-index: 30;
    }
    
    /* 模型按钮优化 */
    .model-row {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .model-row .model-btn {
        width: 100%;
        box-sizing: border-box;
        padding: 10px 8px;
        font-size: 0.85em;
        min-height: 40px;
    }
    
    /* 控制组优化 */
    .control-group {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    .control-group h3 {
        font-size: 0.9em;
    }
    
    /* 按钮组优化 */
    .button-group > button {
        min-height: 36px;
        font-size: 0.8em;
        padding: 6px 4px;
    }
    
    /* 滑块优化 */
    .slider-container span {
        font-size: 0.8em;
        width: 40px;
    }
    
    /* 开关优化 */
    .switch {
        width: 45px;
        height: 24px;
    }
    
    .switch.small {
        width: 35px;
        height: 20px;
    }
    
    .switch .slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    .switch.small .slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }
    
    .switch input:checked + .slider:before {
        transform: translateX(20px);
    }
    
    .switch.small input:checked + .slider:before {
        transform: translateX(14px);
    }
    
    /* 隐藏浮动按钮和全屏按钮 */
    #floating-buttons {
        display: none;
    }
    
    #fullscreen-toggle {
        display: none;
    }
    
    /* 手机端独立浮动按钮样式 */
    #mobile-floating-buttons {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 20px;
        left: 20px;
        gap: 10px;
        z-index: 100;
    }
    
    #mobile-floating-buttons button {
        width: 44px;
        height: 44px;
        background: rgba(30, 30, 30, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    #mobile-floating-buttons button:hover {
        background: rgba(50, 50, 50, 0.9);
        transform: scale(1.1);
    }
    
    #mobile-floating-buttons svg {
        width: 20px;
        height: 20px;
    }
    
    /* 底部坐标轴调整 */
    #bottom-axis-container {
        bottom: 20px;
        width: 80px;
        height: 80px;
    }
    
    /* 标题优化 */
    h1 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .user-level {
        font-size: 0.6em;
        padding: 1px 6px;
    }
} 