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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

#container {
    position: relative;
    width: 100%;
    height: 100%;
}

#camera-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#input_video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    cursor: none;
}

#status {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 0.9rem;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-drawing {
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 1.5s infinite;
}

.status-ready {
    background: #f87171;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    width: 90%;
    max-width: 500px;
}

.control-group {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.slider-container, .color-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.slider-label {
    font-size: 0.9rem;
    white-space: nowrap;
    color: #ccc;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4d96ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(77, 150, 255, 0.6);
}

#color-picker {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}

#color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.control-btn {
    background: rgba(77, 150, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(77, 150, 255, 0.3);
    border-radius: 10px;
    padding: 10px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(77, 150, 255, 0.4);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.1rem;
}

#instructions {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 15px;
    font-size: 0.9rem;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 200px;
}

#instructions h3 {
    margin-bottom: 10px;
    color: #4d96ff;
}

#instructions p {
    margin-bottom: 8px;
    line-height: 1.4;
}

#camera-permission {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.permission-content {
    text-align: center;
    max-width: 400px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.permission-content h2 {
    margin-bottom: 15px;
    color: #4d96ff;
}

.permission-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

#enable-camera {
    margin-top: 10px;
    padding: 12px 24px;
    background: #4d96ff;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#enable-camera:hover {
    background: #3a7bd5;
    transform: translateY(-2px);
}

.privacy-note {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .controls {
        width: 95%;
    }
    
    .control-group {
        flex-direction: column;
    }
    
    .slider-container, .color-picker-container {
        min-width: 100%;
    }
    
    #instructions {
        max-width: 150px;
        font-size: 0.8rem;
    }
    
    #status {
        top: 10px;
        right: 10px;
        font-size: 0.8rem;
    }
}
