/* --- 沉浸式基础样式 --- */
body { 
    margin: 0; 
    padding: 0;
    height: 100vh; 
    overflow: hidden; 
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #1a1a1a; 
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 动态背景模糊层 */
.bg-blur { 
    position: absolute; 
    top: -10%; left: -10%; 
    width: 120%; height: 120%; 
    background-size: cover; 
    background-position: center;
    filter: blur(40px) brightness(0.6); 
    z-index: 0; 
    transition: background-image 1s ease;
}

/* 主预览区 */
.preview-container {
    position: relative;
    z-index: 10;
    width: 90vw;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.preview-img {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border-radius: 8px;
    /* [修改] 初始状态设为全透明，配合JS实现淡入效果 */
    opacity: 0; 
    transition: opacity 0.5s ease, transform 0.3s;
    cursor: pointer;
}

.loading-spinner {
    position: absolute;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- 底部 Dock 控制栏 --- */
.dock-wrapper {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dock-bar {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(15px);
    padding: 12px 20px;
    border-radius: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: rgba(255,255,255,0.6);
    position: relative;
}

.dock-item:hover, .dock-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateY(-5px);
}

.dock-icon { font-size: 24px; margin-bottom: 4px; }
.dock-label { font-size: 10px; font-weight: 500; }
.dock-item.save-btn { background: #3498db; color: white; }
.dock-item.save-btn:hover { background: #2980b9; box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4); }

/* --- 弹出面板 (Popups) --- */
.panel {
    position: absolute;
    bottom: 90px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 340px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s;
    display: none;
}

.panel.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; display: block; }
.panel-title { color: white; font-size: 14px; font-weight: bold; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }

.grid-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 300px; overflow-y: auto; }
.grid-colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 15px;}

.opt-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    color: #ccc;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}
.opt-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.opt-btn.active { background: #3498db; color: white; border-color: #3498db; }

.color-dot { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; position: relative;}
.color-dot.active { border-color: white; transform: scale(1.1); }

.input-group { margin-bottom: 15px; }
.input-label { color: #888; font-size: 11px; margin-bottom: 5px; display: block; }
.dark-input {
    width: 100%; box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.dark-input:focus { border-color: #3498db; background: rgba(0,0,0,0.5); }
.row-inputs { display: flex; gap: 10px; }

.file-upload { 
    border: 1px dashed rgba(255,255,255,0.3); 
    padding: 10px; 
    border-radius: 6px; 
    text-align: center; 
    font-size: 12px; 
    color: #aaa; 
    cursor: pointer;
    position: relative;
}
.file-upload:hover { border-color: #3498db; color: white; }
.file-upload input { position: absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor:pointer; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

@media (max-width: 600px) {
    .dock-bar { padding: 10px; gap: 5px; width: 90vw; justify-content: space-around; }
    .dock-item { width: 50px; }
    .panel { width: 85vw; bottom: 80px; }
}