/**
 * 3D粒子系统样式
 * 现代暗色主题 + 毛玻璃效果
 */

/* 使用独特字体 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Noto+Sans+SC:wght@300;400;500&display=swap');

:root {
    /* 主色调 - 赛博朋克风格 */
    --primary: #ff6b9d;
    --primary-glow: rgba(255, 107, 157, 0.4);
    --secondary: #00f5d4;
    --secondary-glow: rgba(0, 245, 212, 0.3);
    --accent: #9b5de5;
    
    /* 背景色 */
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(15, 15, 25, 0.85);
    --bg-hover: rgba(255, 255, 255, 0.05);
    
    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* 边框 */
    --border: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(255, 107, 157, 0.3);
    
    /* 尺寸 */
    --panel-width: 280px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    min-height: 100vh;
}

/* 3D Canvas 容器 */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* 摄像头预览 */
#camera-preview {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 240px;
    height: 180px;
    border-radius: var(--border-radius);
    overflow: hidden;
    z-index: 100;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#camera-preview.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#camera-preview video {
    display: none;
}

#camera-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#hand-status {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 16px;
    border-radius: 20px;
}

.hand-icon {
    font-size: 24px;
    opacity: 0.3;
    transition: all 0.2s ease;
}

.hand-icon.active {
    opacity: 1;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* 控制面板 */
#control-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: var(--panel-width);
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 24px;
    z-index: 100;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#control-panel h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.control-section {
    margin-bottom: 20px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 模板选择网格 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.template-btn.active {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.2), rgba(155, 93, 229, 0.2));
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.template-btn .icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.template-btn .label {
    font-size: 10px;
    color: var(--text-secondary);
}

/* 颜色选择器 */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="color"] {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    background: transparent;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 4px;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

#color-value {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* 滑块样式 */
input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* 操作按钮 */
.control-section.buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.15), rgba(155, 93, 229, 0.15));
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.25), rgba(155, 93, 229, 0.25));
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .icon {
    font-size: 16px;
}

/* 提示信息 */
.control-section.hint {
    background: rgba(0, 245, 212, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    margin-top: 16px;
    border: 1px solid rgba(0, 245, 212, 0.2);
}

.control-section.hint p {
    font-size: 11px;
    color: var(--secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-section.hint p:last-child {
    margin-bottom: 0;
}

/* 加载提示 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading p {
    margin-top: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #control-panel {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    #camera-preview {
        width: 160px;
        height: 120px;
        bottom: auto;
        top: 20px;
    }
    
    .template-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .template-btn .label {
        display: none;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 25px var(--primary-glow);
    }
}

.template-btn.active {
    animation: glow 2s ease-in-out infinite;
}

/* 选择禁用 */
button, input {
    user-select: none;
}

