/* General Styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

* {
    box-sizing: border-box;
}

/* Main container for video and canvas */
#main-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#video, #output-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#video {
  /* Hidden objects for processing */
  width: 1px;
  height: 1px;
  opacity: 0;   /* 完全透明 */
}

#output-canvas {
    z-index: 10;
}

/* Loading Indicator */
#loading-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

#loading-text {
    font-size: 1.5em;
    color: #fff;
}

/* UI Container */
#ui-container {
    position: absolute;
    z-index: 20;
    background-color: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ui-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ui-section button {
    padding: 10px 15px;
    font-size: 1em;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ui-section button.active {
    background-color: #007aff;
    border-color: #007aff;
}

.ui-section button:hover {
}

.slider-section label {
    font-size: 0.9em;
}

.slider-section input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #555;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

.slider-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007aff;
    border-radius: 50%;
    cursor: pointer;
}

.slider-section input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007aff;
    border-radius: 50%;
    cursor: pointer;
}

/* Desktop Layout */
@media (min-aspect-ratio: 1/1) {
    #ui-container {
        top: 0;
        right: 0;
        width: 220px;
        height: 100%;
        border-left: 1px solid #333;
    }
}

/* Mobile Layout */
@media (max-aspect-ratio: 1/1) {
    #ui-container {
        bottom: 0;
        left: 0;
        width: 100%;
        border-top: 1px solid #333;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 10px;
    }

    .ui-section {
        flex-direction: row;
        gap: 10px;
    }

    .slider-section {
        flex: 1;
        flex-direction: column;
        gap: 8px;
    }

    .slider-section label {
        font-size: 0.8em;
    }

    .ui-section button {
        padding: 8px 10px;
        font-size: 0.9em;
    }
}
