* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #e4e4e4;
    overflow: hidden;
    height: 100vh;
}

.home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    padding: 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #8892b0;
    font-size: 0.9rem;
    margin-top: 5px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: #000;
}

#noise-canvas, #three-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

#noise-canvas {
    display: none;
}

#three-canvas {
    display: block;
}

.view-mode-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.view-btn {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e4e4e4;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.control-panel {
    width: 320px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    padding: 20px;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    color: #64ffda;
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.value-display {
    color: #8892b0;
    font-size: 0.85rem;
    margin-top: 5px;
}

.control-group select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e4e4e4;
    font-size: 0.9rem;
    cursor: pointer;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.color-picker-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.info-text {
    color: #8892b0;
    font-size: 0.8rem;
    line-height: 1.5;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #64ffda;
}

/* 滚动条样式 */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .canvas-container {
        height: 60vh;
    }

    .control-panel {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    header h1 {
        font-size: 1.3rem;
    }

    .view-mode-toggle {
        top: 10px;
        right: 10px;
        gap: 5px;
    }

    .view-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .home-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
