:root {
    --primary-color: #00ffff;
    --bg-color: #050505;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #ffffff;
    --accent-color: #ff0055;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

canvas.output_canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#ui-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

#ui-container:hover {
    box-shadow: 0 15px 40px rgba(0, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Shape Buttons */
.shape-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-shape {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-shape:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-shape.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
    font-weight: 600;
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

#colorValue {
    font-family: monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Status Panel */
.status-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.status-icon {
    font-size: 1.1rem;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* Camera Preview - Hidden as requested */
.camera-container {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 240px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    background: #000;
}

.input_video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* 镜像 */
}

.debug_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* 画布也要镜像以匹配视频 */
}

/* Response to smaller screens */
@media (max-width: 768px) {
    #ui-container {
        width: 100%;
        bottom: 0;
        border-radius: 20px 20px 0 0;
        padding-bottom: 20px;
    }

    .shape-buttons {
        gap: 5px;
    }

    .btn-shape {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .camera-container {
        width: 120px;
        height: 90px;
        bottom: auto;
        top: 20px;
        right: 20px;
    }
}